({ userId, commentId })
| 1379 | } |
| 1380 | |
| 1381 | public static async unreadComment({ userId, commentId }) { |
| 1382 | if (!userId || !commentId) { |
| 1383 | throw new Error('Bad data.'); |
| 1384 | } |
| 1385 | |
| 1386 | await this.updateOne( |
| 1387 | { _id: userId }, |
| 1388 | { |
| 1389 | $push: { |
| 1390 | unreadCommentIds: commentId, |
| 1391 | }, |
| 1392 | }, |
| 1393 | ); |
| 1394 | } |
| 1395 | |
| 1396 | // marks one Comment as unread for participants of Discussion |
| 1397 | public static async markCommentAsUnreadForParticipantsOfDiscussionAfterCommentIsAdded({ |
nothing calls this directly
no outgoing calls
no test coverage detected