tasks.get returns null on not found

This commit is contained in:
Girish Ramakrishnan
2021-07-14 10:59:49 -07:00
parent e59d0e878d
commit ac70350531
2 changed files with 3 additions and 2 deletions

View File

@@ -30,6 +30,7 @@ async function get(req, res, next) {
const [error, task] = await safe(tasks.get(req.params.taskId));
if (error) return next(BoxError.toHttpError(error));
if (!task) return next(new HttpError(404, 'task not found'));
next(new HttpSuccess(200, tasks.removePrivateFields(task)));
}