restore from the backup's config.json

To summarize what we are doing is that restore is simply getting old data and
old code. Config is not changed. If config is required, then it has to come
in the restore REST parameter. Otherwise, there is too much magic.

https://blog.smartserver.io/2016/06/13/app-restore/
This commit is contained in:
Girish Ramakrishnan
2016-06-13 13:44:49 -07:00
parent 2c0eb33625
commit 1763c36a0b
2 changed files with 19 additions and 23 deletions
+2 -1
View File
@@ -178,7 +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'));
if (!('backupId' in req.body)) return next(new HttpError(400, 'backupId is required'));
if (data.backupId !== null && typeof data.backupId !== 'string') return next(new HttpError(400, 'backupId must be string or null'));
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'));