Revert backup policy fallback and check in rest api

Check is now in proper location at backups.testConfig()
This commit is contained in:
Johannes Zellner
2020-05-28 19:50:23 +02:00
parent ea47fb7305
commit b31ac7d1fd
2 changed files with 2 additions and 7 deletions

View File

@@ -106,7 +106,7 @@ function setBackupConfig(req, res, next) {
if (typeof req.body.format !== 'string') return next(new HttpError(400, 'format must be a string'));
if ('acceptSelfSignedCerts' in req.body && typeof req.body.acceptSelfSignedCerts !== 'boolean') return next(new HttpError(400, 'format must be a boolean'));
if (!req.body.retentionPolicy || typeof req.body.retentionPolicy !== 'object' || Object.keys(req.body.retentionPolicy) === 0) return next(new HttpError(400, 'retentionPolicy is required'));
if (!req.body.retentionPolicy || typeof req.body.retentionPolicy !== 'object') return next(new HttpError(400, 'retentionPolicy is required'));
// testing the backup using put/del takes a bit of time at times
req.clearTimeout();