pass data argument to restore

This commit is contained in:
Girish Ramakrishnan
2016-06-13 10:08:58 -07:00
parent ed4674cd14
commit b82610ba00
2 changed files with 6 additions and 2 deletions

View File

@@ -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));