From 77c18d94412c196c6f7f874cdfcb3274a3c59923 Mon Sep 17 00:00:00 2001 From: Hannah dagemark Date: Mon, 31 Aug 2026 02:46:04 +0200 Subject: [PATCH 1/4] Use temp instead of blank --- app/api/projects/{route.ts => [id]/.temp} | 0 app/api/users/[id]/{route.ts => .temp} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename app/api/projects/{route.ts => [id]/.temp} (100%) rename app/api/users/[id]/{route.ts => .temp} (100%) diff --git a/app/api/projects/route.ts b/app/api/projects/[id]/.temp similarity index 100% rename from app/api/projects/route.ts rename to app/api/projects/[id]/.temp diff --git a/app/api/users/[id]/route.ts b/app/api/users/[id]/.temp similarity index 100% rename from app/api/users/[id]/route.ts rename to app/api/users/[id]/.temp -- 2.52.0 From 56d14d5d61bcff5279fc6962c4db81471ef4ae98 Mon Sep 17 00:00:00 2001 From: Hannah dagemark Date: Mon, 31 Aug 2026 02:46:23 +0200 Subject: [PATCH 2/4] Remove dev console log --- app/api/services/route.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/api/services/route.ts b/app/api/services/route.ts index 7c2920f..6c2c440 100644 --- a/app/api/services/route.ts +++ b/app/api/services/route.ts @@ -1,8 +1,6 @@ const BACKEND_URL = process.env.BACKEND_URL; export async function GET() { - console.log("Made it to the GET SERVICES ROUTE!"); - const response = await fetch(`${BACKEND_URL}/services/all`); if (!response.ok) { -- 2.52.0 From 4e38397bfde62ecd70883f6c9eef3d33e8ead157 Mon Sep 17 00:00:00 2001 From: Hannah dagemark Date: Mon, 31 Aug 2026 02:46:35 +0200 Subject: [PATCH 3/4] Use request body --- app/api/services/[id]/route.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/api/services/[id]/route.ts b/app/api/services/[id]/route.ts index 49402bb..7a0914c 100644 --- a/app/api/services/[id]/route.ts +++ b/app/api/services/[id]/route.ts @@ -1,6 +1,9 @@ const BACKEND_URL = process.env.BACKEND_URL; -export async function GET({ params }: { params: Promise<{ id: string }> }) { +export async function GET( + _request: Request, + { params }: { params: Promise<{ id: string }> }, +) { const { id } = await params; const response = await fetch(`${BACKEND_URL}/services/${id}`); @@ -15,7 +18,10 @@ export async function GET({ params }: { params: Promise<{ id: string }> }) { return Response.json(data); } -export async function DELETE({ params }: { params: Promise<{ id: string }> }) { +export async function DELETE( + _request: Request, + { params }: { params: Promise<{ id: string }> }, +) { const { id } = await params; const response = await fetch(`${BACKEND_URL}/services/${id}`, { method: "DELETE", -- 2.52.0 From bad16f57bfe5449c9a241ec80ae9f98117f62f70 Mon Sep 17 00:00:00 2001 From: Hannah dagemark Date: Mon, 31 Aug 2026 02:46:44 +0200 Subject: [PATCH 4/4] Make header render client side --- components/layout/Header.tsx | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/components/layout/Header.tsx b/components/layout/Header.tsx index 19eeb69..3da5a84 100644 --- a/components/layout/Header.tsx +++ b/components/layout/Header.tsx @@ -1,3 +1,7 @@ +"use client"; + +import { useEffect, useState } from "react"; + import Hyperlink from "@/components/ui/Hyperlink"; import { getServices } from "@/lib/api/helpers/services"; import { Service } from "@/lib/api/types"; @@ -40,11 +44,19 @@ const defaultServices: Service[] = [ }, ]; -export default async function Header() { - let services = await getServices(); - if (services.length < 1) { - services = defaultServices; - } +export default function Header() { + const [services, setServices] = useState(defaultServices); + useEffect(() => { + getServices() + .then((services) => { + if (services.length > 0) { + setServices(services); + } + }) + .catch(() => { + // Keep default services if the backend is not reached :C + }); + }, []); return (