wip
This commit is contained in:
parent
67f9c158d7
commit
2a9cba25a8
9 changed files with 77 additions and 126 deletions
|
|
@ -1,27 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
/**
|
||||
* Module dependencies
|
||||
*/
|
||||
import Message from '../../models/messaging-message';
|
||||
|
||||
/**
|
||||
* Get count of unread messages
|
||||
*
|
||||
* @param {any} params
|
||||
* @param {any} user
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
module.exports = (params, user) =>
|
||||
new Promise(async (res, rej) =>
|
||||
{
|
||||
const count = await Message
|
||||
.count({
|
||||
recipient_id: user._id,
|
||||
is_read: false
|
||||
});
|
||||
|
||||
res({
|
||||
count: count
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue