update: if no backup site, show error message

This commit is contained in:
Girish Ramakrishnan
2026-02-24 05:46:09 +01:00
parent dc439ba5be
commit 4be31b0dad
2 changed files with 9 additions and 2 deletions
+5
View File
@@ -2327,6 +2327,11 @@ async function updateApp(app, data, auditSource) {
error = await checkManifest(manifest);
if (error) throw error;
if (!skipBackup) {
const sites = await backupSites.listByContentForUpdates(app.id);
if (sites.length === 0) throw new BoxError(BoxError.BAD_STATE, 'App has no backup site for updates');
}
const updateConfig = { skipBackup, manifest }; // this will clear appStoreId/versionsUrl when updating from a repo and set it if passed in for update route
if ('appStoreId' in data) updateConfig.appStoreId = data.appStoreId;
if ('versionsUrl' in data) updateConfig.versionsUrl = data.versionsUrl;