aboutsummaryrefslogtreecommitdiffstats
path: root/packages/trpc/models/highlights.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/trpc/models/highlights.ts')
-rw-r--r--packages/trpc/models/highlights.ts8
1 files changed, 3 insertions, 5 deletions
diff --git a/packages/trpc/models/highlights.ts b/packages/trpc/models/highlights.ts
index 326f97f3..260c4b8a 100644
--- a/packages/trpc/models/highlights.ts
+++ b/packages/trpc/models/highlights.ts
@@ -11,6 +11,7 @@ import {
import { zCursorV2 } from "@karakeep/shared/types/pagination";
import { AuthedContext } from "..";
+import { BareBookmark } from "./bookmarks";
import { PrivacyAware } from "./privacy";
export class Highlight implements PrivacyAware {
@@ -64,13 +65,10 @@ export class Highlight implements PrivacyAware {
static async getForBookmark(
ctx: AuthedContext,
- bookmarkId: string,
+ bookmark: BareBookmark,
): Promise<Highlight[]> {
const results = await ctx.db.query.highlights.findMany({
- where: and(
- eq(highlights.bookmarkId, bookmarkId),
- eq(highlights.userId, ctx.user.id),
- ),
+ where: eq(highlights.bookmarkId, bookmark.id),
orderBy: [desc(highlights.createdAt), desc(highlights.id)],
});