test: fix tasks test

This commit is contained in:
Girish Ramakrishnan
2025-06-08 15:54:26 +02:00
parent 804be6d5e4
commit cd45046724
2 changed files with 7 additions and 8 deletions
+2 -4
View File
@@ -44,12 +44,10 @@ async function list(req, res, next) {
if (req.query.type && typeof req.query.type !== 'string') return next(new HttpError(400, 'type must be a string'));
let [error, result] = await safe(tasks.listByTypePaged(req.query.type || null, page, perPage));
const [error, result] = await safe(tasks.listByTypePaged(req.query.type || null, page, perPage));
if (error) return next(BoxError.toHttpError(error));
result = result.map(tasks.removePrivateFields);
next(new HttpSuccess(200, { tasks: result }));
next(new HttpSuccess(200, { tasks: result.map(tasks.removePrivateFields) }));
}
async function stopTask(req, res, next) {