backup: rename back backuplisting.js to backups.js
this was a transitional rename till I figured out how to split it in backuptargets.js
This commit is contained in:
@@ -6,7 +6,7 @@ exports = module.exports = {
|
||||
};
|
||||
|
||||
const assert = require('assert'),
|
||||
backupListing = require('../backuplisting.js'),
|
||||
backups = require('../backups.js'),
|
||||
BoxError = require('../boxerror.js'),
|
||||
HttpError = require('@cloudron/connect-lastmile').HttpError,
|
||||
HttpSuccess = require('@cloudron/connect-lastmile').HttpSuccess,
|
||||
@@ -19,7 +19,7 @@ async function list(req, res, next) {
|
||||
const perPage = typeof req.query.per_page === 'string'? parseInt(req.query.per_page) : 25;
|
||||
if (!perPage || perPage < 0) return next(new HttpError(400, 'per_page query param has to be a postive number'));
|
||||
|
||||
const [error, result] = await safe(backupListing.getByIdentifierAndStatePaged(backupListing.BACKUP_IDENTIFIER_BOX, backupListing.BACKUP_STATE_NORMAL, page, perPage));
|
||||
const [error, result] = await safe(backups.getByIdentifierAndStatePaged(backups.BACKUP_IDENTIFIER_BOX, backups.BACKUP_STATE_NORMAL, page, perPage));
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
next(new HttpSuccess(200, { backups: result }));
|
||||
@@ -33,7 +33,7 @@ async function update(req, res, next) {
|
||||
if (typeof label !== 'string') return next(new HttpError(400, 'label must be a string'));
|
||||
if (typeof preserveSecs !== 'number') return next(new HttpError(400, 'preserveSecs must be a number'));
|
||||
|
||||
const [error] = await safe(backupListing.update(req.params.backupId, { label, preserveSecs }));
|
||||
const [error] = await safe(backups.update(req.params.backupId, { label, preserveSecs }));
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
next(new HttpSuccess(200, {}));
|
||||
+1
-1
@@ -8,7 +8,7 @@ exports = module.exports = {
|
||||
appstore: require('./appstore.js'),
|
||||
archives: require('./archives.js'),
|
||||
auth: require('./auth.js'),
|
||||
backupListing: require('./backuplisting.js'),
|
||||
backups: require('./backups.js'),
|
||||
backupTargets: require('./backuptargets.js'),
|
||||
branding: require('./branding.js'),
|
||||
cloudron: require('./cloudron.js'),
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
'use strict';
|
||||
|
||||
const archives = require('../../archives.js'),
|
||||
backupListing = require('../../backuplisting.js'),
|
||||
backups = require('../../backups.js'),
|
||||
common = require('./common.js'),
|
||||
expect = require('expect.js'),
|
||||
superagent = require('@cloudron/superagent');
|
||||
@@ -19,8 +19,8 @@ describe('Archives API', function () {
|
||||
remotePath: 'app_appid_123',
|
||||
encryptionVersion: null,
|
||||
packageVersion: '1.0.0',
|
||||
type: backupListing.BACKUP_TYPE_APP,
|
||||
state: backupListing.BACKUP_STATE_CREATING,
|
||||
type: backups.BACKUP_TYPE_APP,
|
||||
state: backups.BACKUP_STATE_CREATING,
|
||||
identifier: 'appid',
|
||||
dependsOn: [ ],
|
||||
manifest: { foo: 'bar' },
|
||||
@@ -33,7 +33,7 @@ describe('Archives API', function () {
|
||||
|
||||
before(async function () {
|
||||
await setup();
|
||||
appBackup.id = await backupListing.add(appBackup);
|
||||
appBackup.id = await backups.add(appBackup);
|
||||
archiveId = await archives.add(appBackup.id, {}, auditSource);
|
||||
});
|
||||
after(cleanup);
|
||||
|
||||
Reference in New Issue
Block a user