volume: remove private fields
This commit is contained in:
@@ -45,7 +45,7 @@ async function add(req, res, next) {
|
||||
async function get(req, res, next) {
|
||||
assert.strictEqual(typeof req.params.id, 'string');
|
||||
|
||||
next(new HttpSuccess(200, req.resource));
|
||||
next(new HttpSuccess(200, volumes.removePrivateFields(req.resource)));
|
||||
}
|
||||
|
||||
async function del(req, res, next) {
|
||||
@@ -59,7 +59,10 @@ async function del(req, res, next) {
|
||||
async function list(req, res, next) {
|
||||
const [error, result] = await safe(volumes.list());
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
next(new HttpSuccess(200, { volumes: result }));
|
||||
|
||||
const allVolumes = result.map(volumes.removePrivateFields);
|
||||
|
||||
next(new HttpSuccess(200, { volumes: allVolumes }));
|
||||
}
|
||||
|
||||
async function getStatus(req, res, next) {
|
||||
|
||||
Reference in New Issue
Block a user