backup: add a dummy removePrivateFields
This commit is contained in:
@@ -11,6 +11,8 @@ exports = module.exports = {
|
||||
list,
|
||||
del,
|
||||
|
||||
removePrivateFields,
|
||||
|
||||
BACKUP_IDENTIFIER_BOX: 'box',
|
||||
BACKUP_IDENTIFIER_MAIL: 'mail',
|
||||
|
||||
@@ -52,6 +54,10 @@ function postProcess(result) {
|
||||
return result;
|
||||
}
|
||||
|
||||
function removePrivateFields(backup) {
|
||||
return backup;
|
||||
}
|
||||
|
||||
async function add(data) {
|
||||
assert(data && typeof data === 'object');
|
||||
assert.strictEqual(typeof data.remotePath, 'string');
|
||||
|
||||
@@ -30,7 +30,7 @@ async function load(req, res, next) {
|
||||
async function get(req, res, next) {
|
||||
assert.strictEqual(typeof req.params.id, 'string');
|
||||
|
||||
next(new HttpSuccess(200, req.resources.backup));
|
||||
next(new HttpSuccess(200, backups.removePrivateFields(req.resources.backup)));
|
||||
}
|
||||
|
||||
async function list(req, res, next) {
|
||||
@@ -43,7 +43,7 @@ async function list(req, res, next) {
|
||||
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 }));
|
||||
next(new HttpSuccess(200, { backups: result.map(backups.removePrivateFields) }));
|
||||
}
|
||||
|
||||
async function update(req, res, next) {
|
||||
|
||||
Reference in New Issue
Block a user