({ userId, commentId })
| 1364 | } |
| 1365 | |
| 1366 | public static async readComment({ userId, commentId }) { |
| 1367 | if (!userId || !commentId) { |
| 1368 | throw new Error('Bad data.'); |
| 1369 | } |
| 1370 | |
| 1371 | await this.updateOne( |
| 1372 | { _id: userId }, |
| 1373 | { |
| 1374 | $pull: { |
| 1375 | unreadCommentIds: commentId, |
| 1376 | }, |
| 1377 | }, |
| 1378 | ); |
| 1379 | } |
| 1380 | |
| 1381 | public static async unreadComment({ userId, commentId }) { |
| 1382 | if (!userId || !commentId) { |
nothing calls this directly
no outgoing calls
no test coverage detected