Rename getByIdentifierAndStatePaged to listByIdentifierAndStatePaged

This commit is contained in:
Girish Ramakrishnan
2026-02-15 12:15:55 +01:00
parent eae86d15ef
commit fc2e39f41b
6 changed files with 22 additions and 22 deletions

View File

@@ -1463,7 +1463,7 @@ async function listBackups(app, page, perPage) {
assert(typeof page === 'number' && page > 0);
assert(typeof perPage === 'number' && perPage > 0);
return await backups.getByIdentifierAndStatePaged(app.id, backups.BACKUP_STATE_NORMAL, page, perPage);
return await backups.listByIdentifierAndStatePaged(app.id, backups.BACKUP_STATE_NORMAL, page, perPage);
}
async function listEventlog(app, page, perPage) {
@@ -2743,7 +2743,7 @@ async function archive(app, backupId, auditSource) {
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);
const result = await backups.listByIdentifierAndStatePaged(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');
@@ -2890,7 +2890,7 @@ async function restoreApps(apps, options, auditSource) {
apps = apps.filter(app => app.installationState !== ISTATE_PENDING_RESTORE); // safeguard against tasks being created non-stop if we crash on startup
for (const app of apps) {
const [error, results] = await safe(backups.getByIdentifierAndStatePaged(app.id, backups.BACKUP_STATE_NORMAL, 1, 1));
const [error, results] = await safe(backups.listByIdentifierAndStatePaged(app.id, backups.BACKUP_STATE_NORMAL, 1, 1));
let installationState, restoreConfig;
if (!error && results.length) {
installationState = ISTATE_PENDING_RESTORE;