aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorMohamedBassem <me@mbassem.com>2024-04-06 00:18:18 +0100
committerMohamedBassem <me@mbassem.com>2024-04-06 00:18:18 +0100
commita81c3941465e4fe650049e2557b9d5bbc67d47a8 (patch)
treedc4e02ea46aa85ebd0d20970a2cbdd0faff4a022 /packages
parent91b088db868eecc0d048e52a3529846ae4d5c580 (diff)
downloadkarakeep-a81c3941465e4fe650049e2557b9d5bbc67d47a8.tar.zst
feature: Change archived meaning to only mean removed from homepage
Diffstat (limited to 'packages')
-rw-r--r--packages/trpc/routers/tags.ts12
1 files changed, 2 insertions, 10 deletions
diff --git a/packages/trpc/routers/tags.ts b/packages/trpc/routers/tags.ts
index ec633603..b69c98e8 100644
--- a/packages/trpc/routers/tags.ts
+++ b/packages/trpc/routers/tags.ts
@@ -2,7 +2,7 @@ import { experimental_trpcMiddleware, TRPCError } from "@trpc/server";
import { and, count, eq } from "drizzle-orm";
import { z } from "zod";
-import { bookmarks, bookmarkTags, tagsOnBookmarks } from "@hoarder/db/schema";
+import { bookmarkTags, tagsOnBookmarks } from "@hoarder/db/schema";
import type { Context } from "../index";
import type { ZAttachedByEnum } from "../types/tags";
@@ -88,12 +88,10 @@ export const tagsAppRouter = router({
})
.from(bookmarkTags)
.leftJoin(tagsOnBookmarks, eq(bookmarkTags.id, tagsOnBookmarks.tagId))
- .leftJoin(bookmarks, eq(tagsOnBookmarks.bookmarkId, bookmarks.id))
.where(
and(
conditionFromInput(input, ctx.user.id),
eq(bookmarkTags.userId, ctx.user.id),
- eq(bookmarks.archived, false),
),
);
@@ -161,13 +159,7 @@ export const tagsAppRouter = router({
.from(tagsOnBookmarks)
.groupBy(tagsOnBookmarks.tagId, tagsOnBookmarks.attachedBy)
.innerJoin(bookmarkTags, eq(bookmarkTags.id, tagsOnBookmarks.tagId))
- .leftJoin(bookmarks, eq(tagsOnBookmarks.bookmarkId, bookmarks.id))
- .where(
- and(
- eq(bookmarkTags.userId, ctx.user.id),
- eq(bookmarks.archived, false),
- ),
- );
+ .where(eq(bookmarkTags.userId, ctx.user.id));
const tags = res.reduce<Record<string, z.infer<typeof zTagSchema>>>(
(acc, row) => {