From dc6e0eab70421749faaa9a802d66c1901f3e9b50 Mon Sep 17 00:00:00 2001
From: MohamedBassem
Date: Sun, 31 Mar 2024 16:34:52 +0100
Subject: feature: Add support deleting tags
---
apps/web/app/dashboard/lists/[listId]/page.tsx | 8 +-------
apps/web/app/dashboard/tags/[tagName]/page.tsx | 15 ++++++++-------
2 files changed, 9 insertions(+), 14 deletions(-)
(limited to 'apps/web/app')
diff --git a/apps/web/app/dashboard/lists/[listId]/page.tsx b/apps/web/app/dashboard/lists/[listId]/page.tsx
index e27e1841..4d7df133 100644
--- a/apps/web/app/dashboard/lists/[listId]/page.tsx
+++ b/apps/web/app/dashboard/lists/[listId]/page.tsx
@@ -1,9 +1,8 @@
-import { notFound, redirect } from "next/navigation";
+import { notFound } from "next/navigation";
import Bookmarks from "@/components/dashboard/bookmarks/Bookmarks";
import DeleteListButton from "@/components/dashboard/lists/DeleteListButton";
import { BookmarkListContextProvider } from "@/lib/hooks/list-context";
import { api } from "@/server/api/client";
-import { getServerAuthSession } from "@/server/auth";
import { TRPCError } from "@trpc/server";
export default async function ListPage({
@@ -11,11 +10,6 @@ export default async function ListPage({
}: {
params: { listId: string };
}) {
- const session = await getServerAuthSession();
- if (!session) {
- redirect("/");
- }
-
let list;
try {
list = await api.lists.get({ listId: params.listId });
diff --git a/apps/web/app/dashboard/tags/[tagName]/page.tsx b/apps/web/app/dashboard/tags/[tagName]/page.tsx
index 0e9e722e..3705a6d1 100644
--- a/apps/web/app/dashboard/tags/[tagName]/page.tsx
+++ b/apps/web/app/dashboard/tags/[tagName]/page.tsx
@@ -1,7 +1,7 @@
-import { notFound, redirect } from "next/navigation";
+import { notFound } from "next/navigation";
import Bookmarks from "@/components/dashboard/bookmarks/Bookmarks";
+import DeleteTagButton from "@/components/dashboard/tags/DeleteTagButton";
import { api } from "@/server/api/client";
-import { getServerAuthSession } from "@/server/auth";
import { TRPCError } from "@trpc/server";
export default async function TagPage({
@@ -9,10 +9,6 @@ export default async function TagPage({
}: {
params: { tagName: string };
}) {
- const session = await getServerAuthSession();
- if (!session) {
- redirect("/");
- }
const tagName = decodeURIComponent(params.tagName);
let tag;
@@ -29,7 +25,12 @@ export default async function TagPage({
return (
{tagName}
}
+ header={
+
+ {tagName}
+
+
+ }
query={{ archived: false, tagId: tag.id }}
/>
);
--
cgit v1.2.3-70-g09d2