Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/domain/mark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export interface markRequest {
parent_id: number
comment?: string
bm_id?: number
bookmark_uid?: string
share_code?: string
collection_code?: string
cb_id?: number
Expand Down Expand Up @@ -140,7 +141,13 @@ export class MarkService {
let userId = 0

const bookmarkHandle = async () => {
bmId = ctx.hashIds.decodeId(data.bm_id || 0)
if (data.bm_id) {
bmId = ctx.hashIds.decodeId(data.bm_id || 0)
} else if (data.bookmark_uid) {
const bm = await this.bookmarkRepo.getUserBookmarkByUId(data.bookmark_uid, ctx.getUserId())
bm && (bmId = bm.bookmark_id)
}

if (bmId < 1) throw BookmarkNotFoundError()
userId = ctx.getUserId()
}
Expand Down
Loading