Minor fixes.
This commit is contained in:
parent
3f7ec9e0c2
commit
d8153d1263
@ -9,7 +9,8 @@ do ->
|
|||||||
'task'
|
'task'
|
||||||
]
|
]
|
||||||
$_.each types, (type) ->
|
$_.each types, (type) ->
|
||||||
exports["#{type}.destroy"] = (session, request) ->
|
exports[type] ?= {}
|
||||||
|
exports[type].destroy = (session, request) ->
|
||||||
{id} = request.params
|
{id} = request.params
|
||||||
@throw 'INVALID_PARAMS' unless id?
|
@throw 'INVALID_PARAMS' unless id?
|
||||||
|
|
||||||
@ -19,7 +20,7 @@ do ->
|
|||||||
@checkPermission session, 'admin'
|
@checkPermission session, 'admin'
|
||||||
|
|
||||||
# Retrieves the object.
|
# Retrieves the object.
|
||||||
object = @xo.objects.get id
|
object = @xo.xobjs.get id
|
||||||
@throw 'NO_SUCH_OBJECT' unless object?
|
@throw 'NO_SUCH_OBJECT' unless object?
|
||||||
|
|
||||||
# Gets the corresponding connection.
|
# Gets the corresponding connection.
|
||||||
|
Loading…
Reference in New Issue
Block a user