From a81c3941465e4fe650049e2557b9d5bbc67d47a8 Mon Sep 17 00:00:00 2001 From: MohamedBassem Date: Sat, 6 Apr 2024 00:18:18 +0100 Subject: feature: Change archived meaning to only mean removed from homepage --- packages/trpc/routers/tags.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'packages') 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>>( (acc, row) => { -- cgit v1.2.3-70-g09d2