Skip to content

Commit 7f4bf4d

Browse files
committed
add msg
1 parent 47d9e25 commit 7f4bf4d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/conversations.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fns.newConversation = (message, next) => {
1515
db.countByIds(messageData.participants.map(user => user.user_id), 'users')
1616
.then(foundUsers => {
1717
if (messageData.participants.length !== foundUsers) {
18-
return next(null, {err: 'NOT_FOUND'});
18+
return next(null, {err: {msg: 'USER_NOT_FOUND'}});
1919
}
2020
})
2121
.then(db.insertOne(messageData, 'conversations'))
@@ -47,7 +47,7 @@ fns.getConversationById = (message, next) => {
4747
db.findById(data.conversation_id, 'conversations')
4848
.then(queryResult => {
4949
if (!queryResult) {
50-
return next(null, {err: 'NOT_FOUND'});
50+
return next(null, {err: {msg: 'NOT_FOUND'}});
5151
}
5252
next(null, {data: queryResult});
5353
})

0 commit comments

Comments
 (0)