aboutsummaryrefslogtreecommitdiffstats
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
parent91b088db868eecc0d048e52a3529846ae4d5c580 (diff)
downloadkarakeep-a81c3941465e4fe650049e2557b9d5bbc67d47a8.tar.zst
feature: Change archived meaning to only mean removed from homepage
-rw-r--r--apps/mobile/app/dashboard/favourites.tsx1
-rw-r--r--apps/mobile/app/dashboard/lists/[slug].tsx1
-rw-r--r--apps/mobile/app/dashboard/tags/[slug].tsx1
-rw-r--r--apps/web/app/dashboard/favourites/page.tsx2
-rw-r--r--apps/web/app/dashboard/lists/[listId]/page.tsx2
-rw-r--r--apps/web/app/dashboard/tags/[tagName]/page.tsx2
-rw-r--r--packages/trpc/routers/tags.ts12
7 files changed, 5 insertions, 16 deletions
diff --git a/apps/mobile/app/dashboard/favourites.tsx b/apps/mobile/app/dashboard/favourites.tsx
index abda5cfa..fb39504b 100644
--- a/apps/mobile/app/dashboard/favourites.tsx
+++ b/apps/mobile/app/dashboard/favourites.tsx
@@ -7,7 +7,6 @@ export default function Favourites() {
<CustomSafeAreaView>
<UpdatingBookmarkList
query={{
- archived: false,
favourited: true,
}}
header={<PageTitle title="⭐️ Favourites" />}
diff --git a/apps/mobile/app/dashboard/lists/[slug].tsx b/apps/mobile/app/dashboard/lists/[slug].tsx
index d42cc653..ccde00a8 100644
--- a/apps/mobile/app/dashboard/lists/[slug].tsx
+++ b/apps/mobile/app/dashboard/lists/[slug].tsx
@@ -26,7 +26,6 @@ export default function ListView() {
<View>
<UpdatingBookmarkList
query={{
- archived: false,
listId: list.id,
}}
header={<PageTitle title={`${list.icon} ${list.name}`} />}
diff --git a/apps/mobile/app/dashboard/tags/[slug].tsx b/apps/mobile/app/dashboard/tags/[slug].tsx
index ea1ef63d..23d00a7c 100644
--- a/apps/mobile/app/dashboard/tags/[slug].tsx
+++ b/apps/mobile/app/dashboard/tags/[slug].tsx
@@ -27,7 +27,6 @@ export default function TagView() {
<View>
<UpdatingBookmarkList
query={{
- archived: false,
tagId: tag.id,
}}
header={<PageTitle title={tag.name} />}
diff --git a/apps/web/app/dashboard/favourites/page.tsx b/apps/web/app/dashboard/favourites/page.tsx
index 8df601c4..13d793c6 100644
--- a/apps/web/app/dashboard/favourites/page.tsx
+++ b/apps/web/app/dashboard/favourites/page.tsx
@@ -4,7 +4,7 @@ export default async function FavouritesBookmarkPage() {
return (
<Bookmarks
header={<p className="text-2xl">⭐️ Favourites</p>}
- query={{ favourited: true, archived: false }}
+ query={{ favourited: true }}
showDivider={true}
/>
);
diff --git a/apps/web/app/dashboard/lists/[listId]/page.tsx b/apps/web/app/dashboard/lists/[listId]/page.tsx
index 4d7df133..2b8025e5 100644
--- a/apps/web/app/dashboard/lists/[listId]/page.tsx
+++ b/apps/web/app/dashboard/lists/[listId]/page.tsx
@@ -25,7 +25,7 @@ export default async function ListPage({
return (
<BookmarkListContextProvider listId={list.id}>
<Bookmarks
- query={{ listId: list.id, archived: false }}
+ query={{ listId: list.id }}
showDivider={true}
header={
<div className="flex justify-between">
diff --git a/apps/web/app/dashboard/tags/[tagName]/page.tsx b/apps/web/app/dashboard/tags/[tagName]/page.tsx
index 3705a6d1..6bbb5234 100644
--- a/apps/web/app/dashboard/tags/[tagName]/page.tsx
+++ b/apps/web/app/dashboard/tags/[tagName]/page.tsx
@@ -31,7 +31,7 @@ export default async function TagPage({
<DeleteTagButton tagName={tag.name} tagId={tag.id} />
</div>
}
- query={{ archived: false, tagId: tag.id }}
+ query={{ tagId: tag.id }}
/>
);
}
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) => {