diff --git a/src/apps.js b/src/apps.js index a3bcf4816..329d42b2b 100644 --- a/src/apps.js +++ b/src/apps.js @@ -2591,9 +2591,9 @@ async function archive(app, backupId, auditSource) { if (result[0].id !== backupId) throw new BoxError(BoxError.BAD_STATE, 'Latest backup id has changed'); const icons = await getIcons(app.id); - await archives.add(backupId, { icon: icons.icon, appStoreIcon: icons.appStoreIcon, appConfig: app }, auditSource); + const archiveId = await archives.add(backupId, { icon: icons.icon, appStoreIcon: icons.appStoreIcon, appConfig: app }, auditSource); const { taskId } = await uninstall(app, auditSource); - return { taskId }; + return { taskId, id: archiveId }; } async function start(app, auditSource) { diff --git a/src/routes/apps.js b/src/routes/apps.js index a7a0f38e3..e931e67c2 100644 --- a/src/routes/apps.js +++ b/src/routes/apps.js @@ -654,7 +654,7 @@ async function archive(req, res, next) { const [error, result] = await safe(apps.archive(req.app, req.body.backupId, AuditSource.fromRequest(req))); if (error) return next(BoxError.toHttpError(error)); - next(new HttpSuccess(202, { taskId: result.taskId })); + next(new HttpSuccess(202, { taskId: result.taskId, id: result.id })); } async function start(req, res, next) {