Fix up notification tests

This commit is contained in:
Johannes Zellner
2019-01-21 08:51:04 +01:00
parent 4b7090cf7c
commit 8cc07e51bf
3 changed files with 24 additions and 3 deletions

View File

@@ -30,6 +30,7 @@ function add(notification, callback) {
const args = [ notification.userId, notification.eventId, notification.title, notification.message, notification.action ];
database.query(query, args, function (error, result) {
if (error && error.code === 'ER_NO_REFERENCED_ROW_2') return callback(new DatabaseError(DatabaseError.NOT_FOUND, 'no such eventlog entry'));
if (error) return callback(new DatabaseError(DatabaseError.INTERNAL_ERROR, error));
callback(null, String(result.insertId));