Add notification tests for business logic

This commit is contained in:
Johannes Zellner
2019-01-04 17:13:52 +01:00
parent 808be96de3
commit b9daa62ece
3 changed files with 167 additions and 3 deletions

View File

@@ -43,7 +43,7 @@ function list(req, res, next) {
if (req.query.acknowledged && typeof req.query.acknowledged !== 'boolean') return next(new HttpError(400, 'acknowledged must be a boolean'));
notifications.listPaged(req.user.id, typeof req.query.acknowledged === 'undefined' ? null : !!req.query.acknowledged, page, perPage, function (error, result) {
notifications.getAllPaged(req.user.id, typeof req.query.acknowledged === 'undefined' ? null : !!req.query.acknowledged, page, perPage, function (error, result) {
if (error) return next(new HttpError(500, error));
next(new HttpSuccess(200, { notifications: result }));