backups: fix restore code path after backup id changes

This commit is contained in:
Girish Ramakrishnan
2022-04-05 09:28:30 -07:00
parent b4b999bd74
commit 709d4041b2
7 changed files with 38 additions and 34 deletions

View File

@@ -481,8 +481,8 @@ async function importApp(req, res, next) {
const data = req.body;
if ('backupId' in data) { // if not provided, we import in-place
if (typeof data.backupId !== 'string') return next(new HttpError(400, 'backupId must be string'));
if ('remotePath' in data) { // if not provided, we import in-place
if (typeof data.remotePath !== 'string') return next(new HttpError(400, 'remotePath must be string'));
if (typeof data.backupFormat !== 'string') return next(new HttpError(400, 'backupFormat must be string'));
if ('backupConfig' in data && typeof data.backupConfig !== 'object') return next(new HttpError(400, 'backupConfig must be an object'));