backups: fix restore code path after backup id changes
This commit is contained in:
@@ -106,7 +106,7 @@ async function restore(req, res, next) {
|
||||
if (typeof backupConfig.format !== 'string') return next(new HttpError(400, 'format must be a string'));
|
||||
if ('acceptSelfSignedCerts' in backupConfig && typeof backupConfig.acceptSelfSignedCerts !== 'boolean') return next(new HttpError(400, 'format must be a boolean'));
|
||||
|
||||
if (typeof req.body.backupId !== 'string') return next(new HttpError(400, 'backupId must be a string'));
|
||||
if (typeof req.body.remotePath !== 'string') return next(new HttpError(400, 'remotePath must be a string'));
|
||||
if (typeof req.body.version !== 'string') return next(new HttpError(400, 'version must be a string'));
|
||||
|
||||
if ('sysinfoConfig' in req.body && typeof req.body.sysinfoConfig !== 'object') return next(new HttpError(400, 'sysinfoConfig must be an object'));
|
||||
@@ -116,7 +116,7 @@ async function restore(req, res, next) {
|
||||
skipDnsSetup: req.body.skipDnsSetup || false
|
||||
};
|
||||
|
||||
const [error] = await safe(provision.restore(backupConfig, req.body.backupId, req.body.version, req.body.sysinfoConfig || { provider: 'generic' }, options, AuditSource.fromRequest(req)));
|
||||
const [error] = await safe(provision.restore(backupConfig, req.body.remotePath, req.body.version, req.body.sysinfoConfig || { provider: 'generic' }, options, AuditSource.fromRequest(req)));
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
next(new HttpSuccess(200, {}));
|
||||
|
||||
Reference in New Issue
Block a user