archive: proxy app cannot be archived
This commit is contained in:
@@ -2491,6 +2491,8 @@ async function archive(app, backupId, auditSource) {
|
||||
assert.strictEqual(typeof backupId, 'string');
|
||||
assert.strictEqual(typeof auditSource, 'object');
|
||||
|
||||
if (app.manifest.id === constants.PROXY_APP_APPSTORE_ID) throw new BoxError(BoxError.BAD_FIELD, 'cannot archive proxy app');
|
||||
|
||||
const result = await backups.getByIdentifierAndStatePaged(app.id, backups.BACKUP_STATE_NORMAL, 1, 1);
|
||||
if (result.length === 0) throw new BoxError(BoxError.BAD_STATE, 'No recent backup to archive');
|
||||
if (result[0].id !== backupId) throw new BoxError(BoxError.BAD_STATE, 'Latest backup id has changed');
|
||||
|
||||
Reference in New Issue
Block a user