backup: add a dummy removePrivateFields

This commit is contained in:
Girish Ramakrishnan
2025-08-13 19:45:52 +05:30
parent 0c79dcdf1b
commit 39cad02e0d
2 changed files with 8 additions and 2 deletions
+6
View File
@@ -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');
+2 -2
View File
@@ -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) {