diff --git a/src/apps.js b/src/apps.js index e104aa16e..b10aeda35 100644 --- a/src/apps.js +++ b/src/apps.js @@ -661,8 +661,9 @@ function getLogs(appId, lines, follow, callback) { }); } -function restore(appId, auditSource, callback) { +function restore(appId, data, auditSource, callback) { assert.strictEqual(typeof appId, 'string'); + assert.strictEqual(typeof data, 'object'); assert.strictEqual(typeof auditSource, 'object'); assert.strictEqual(typeof callback, 'function'); diff --git a/src/routes/apps.js b/src/routes/apps.js index 31fd37fb2..72b55e40b 100644 --- a/src/routes/apps.js +++ b/src/routes/apps.js @@ -171,11 +171,14 @@ function configureApp(req, res, next) { } function restoreApp(req, res, next) { + assert.strictEqual(typeof req.body, 'object'); assert.strictEqual(typeof req.params.id, 'string'); + var data = req.body; + debug('Restore app id:%s', req.params.id); - apps.restore(req.params.id, auditSource(req), function (error) { + apps.restore(req.params.id, data, auditSource(req), function (error) { if (error && error.reason === AppsError.NOT_FOUND) return next(new HttpError(404, 'No such app')); if (error && error.reason === AppsError.BAD_FIELD) return next(new HttpError(400, error.message)); if (error && error.reason === AppsError.BAD_STATE) return next(new HttpError(409, error.message));