MCPcopy Create free account
hub / github.com/Y80/bmm / query

Function query

src/controllers/UserBookmark.controller.ts:104–114  ·  view source on GitHub ↗
(bookmark: Pick<SelectUserBookmark, 'id'>)

Source from the content-addressed store, hash-verified

102 return rows[0]
103 },
104 async query(bookmark: Pick<SelectUserBookmark, 'id'>) {
105 const res = await db.query.userBookmarks.findFirst({
106 where: userLimiter(await getAuthedUserId(), bookmark.id),
107 with: { relatedTagIds: true },
108 })
109 if (!res) throw new Error('书签不存在')
110 return {
111 ...res,
112 relatedTagIds: res.relatedTagIds.map((el) => el.tId),
113 }
114 },
115 async update(bookmark: Partial<SelectUserBookmark> & Pick<SelectUserBookmark, 'id'>) {
116 const {
117 relatedTagIds,

Callers

nothing calls this directly

Calls 2

getAuthedUserIdFunction · 0.90
userLimiterFunction · 0.70

Tested by

no test coverage detected