pass the lastBackupId explicity as the backup to restore to

This commit is contained in:
Girish Ramakrishnan
2016-06-13 10:13:54 -07:00
parent b82610ba00
commit a2ec308155
4 changed files with 8 additions and 3 deletions

View File

@@ -178,6 +178,8 @@ function restoreApp(req, res, next) {
debug('Restore app id:%s', req.params.id);
if ('backupId' in data && typeof data.backupId !== 'string') return next(new HttpError(400, 'backupId must be string'));
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));