From cd22c6824f4d00083fd9bd5a860b905647d9cdec Mon Sep 17 00:00:00 2001 From: andrewthien Date: Fri, 2 Aug 2024 13:05:15 +0100 Subject: [PATCH] testing removing api --- app/api/templates/base.html | 2 +- app/next-client-app/api/index.ts | 4 +++- app/next-client-app/app/layout.tsx | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/api/templates/base.html b/app/api/templates/base.html index 65988b956..8e6950db2 100644 --- a/app/api/templates/base.html +++ b/app/api/templates/base.html @@ -20,7 +20,7 @@ - + diff --git a/app/next-client-app/api/index.ts b/app/next-client-app/api/index.ts index 89dacaccd..95b1e01aa 100644 --- a/app/next-client-app/api/index.ts +++ b/app/next-client-app/api/index.ts @@ -1,5 +1,6 @@ "use server"; import request from "@/lib/api/request"; +import { redirect } from "next/navigation"; const fetchKeys = { specificUser: () => `userspecific`, @@ -9,6 +10,7 @@ export async function getUser(): Promise { try { return await request(fetchKeys.specificUser()); } catch (error) { - return []; + console.log("dasd"); + redirect("/accounts/login/"); } } diff --git a/app/next-client-app/app/layout.tsx b/app/next-client-app/app/layout.tsx index 041223b4f..edfc017e0 100644 --- a/app/next-client-app/app/layout.tsx +++ b/app/next-client-app/app/layout.tsx @@ -16,7 +16,7 @@ export default async function RootLayout({ }: Readonly<{ children: React.ReactNode; }>) { - const user = await getUser(); + // const user = await getUser(); return (