MCPcopy Create free account
hub / github.com/async-labs/async / pinChat

Method pinChat

api/server/models/User.ts:1426–1439  ·  view source on GitHub ↗
({ userId, chatId })

Source from the content-addressed store, hash-verified

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) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected