(bookmark: Pick<SelectUserBookmark, 'id'>)
| 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, |
nothing calls this directly
no test coverage detected