({ userId, chatId })
| 1424 | } |
| 1425 | |
| 1426 | public static async pinChat({ userId, chatId }) { |
| 1427 | if (!userId || !chatId) { |
| 1428 | throw new Error('Bad data.'); |
| 1429 | } |
| 1430 | |
| 1431 | await this.updateOne( |
| 1432 | { _id: userId }, |
| 1433 | { |
| 1434 | $push: { |
| 1435 | pinnedChatIds: chatId, |
| 1436 | }, |
| 1437 | }, |
| 1438 | ); |
| 1439 | } |
| 1440 | |
| 1441 | public static async unpinChat({ userId, chatId }) { |
| 1442 | if (!userId || !chatId) { |
nothing calls this directly
no outgoing calls
no test coverage detected