We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 47d9e25 commit 7f4bf4dCopy full SHA for 7f4bf4d
lib/conversations.js
@@ -15,7 +15,7 @@ fns.newConversation = (message, next) => {
15
db.countByIds(messageData.participants.map(user => user.user_id), 'users')
16
.then(foundUsers => {
17
if (messageData.participants.length !== foundUsers) {
18
- return next(null, {err: 'NOT_FOUND'});
+ return next(null, {err: {msg: 'USER_NOT_FOUND'}});
19
}
20
})
21
.then(db.insertOne(messageData, 'conversations'))
@@ -47,7 +47,7 @@ fns.getConversationById = (message, next) => {
47
db.findById(data.conversation_id, 'conversations')
48
.then(queryResult => {
49
if (!queryResult) {
50
+ return next(null, {err: {msg: 'NOT_FOUND'}});
51
52
next(null, {data: queryResult});
53
0 commit comments