({ userId, discussionId })
| 1334 | } |
| 1335 | |
| 1336 | public static async pinDiscussion({ userId, discussionId }) { |
| 1337 | if (!userId || !discussionId) { |
| 1338 | throw new Error('Bad data.'); |
| 1339 | } |
| 1340 | |
| 1341 | await this.updateOne( |
| 1342 | { _id: userId }, |
| 1343 | { |
| 1344 | $push: { |
| 1345 | pinnedDiscussionIds: discussionId, |
| 1346 | }, |
| 1347 | }, |
| 1348 | ); |
| 1349 | } |
| 1350 | |
| 1351 | public static async unpinDiscussion({ userId, discussionId }) { |
| 1352 | if (!userId || !discussionId) { |
nothing calls this directly
no outgoing calls
no test coverage detected