From d8153d12637c4664680874220e5ec8221b127ab4 Mon Sep 17 00:00:00 2001 From: Julien Fontanet Date: Mon, 6 Jan 2014 14:52:58 +0100 Subject: [PATCH] Minor fixes. --- src/api/xapi/index.coffee | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/api/xapi/index.coffee b/src/api/xapi/index.coffee index 39aa739dd..c562950b4 100644 --- a/src/api/xapi/index.coffee +++ b/src/api/xapi/index.coffee @@ -9,7 +9,8 @@ do -> 'task' ] $_.each types, (type) -> - exports["#{type}.destroy"] = (session, request) -> + exports[type] ?= {} + exports[type].destroy = (session, request) -> {id} = request.params @throw 'INVALID_PARAMS' unless id? @@ -19,7 +20,7 @@ do -> @checkPermission session, 'admin' # Retrieves the object. - object = @xo.objects.get id + object = @xo.xobjs.get id @throw 'NO_SUCH_OBJECT' unless object? # Gets the corresponding connection.