From 8f95457096a2b73528b5ea9e5325771e64235979 Mon Sep 17 00:00:00 2001 From: mauro-balades Date: Tue, 27 Aug 2024 16:35:21 +0200 Subject: [PATCH] chore: Update next.config to export output --- next.config.mjs | 2 +- src/app/api/get-theme/route.ts | 30 ------------------------------ 2 files changed, 1 insertion(+), 31 deletions(-) delete mode 100644 src/app/api/get-theme/route.ts diff --git a/next.config.mjs b/next.config.mjs index 91fe0e6..88624b5 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -1,6 +1,6 @@ /** @type {import('next').NextConfig} */ const nextConfig = { - //output: 'export', + output: 'export', images: { remotePatterns: [ { diff --git a/src/app/api/get-theme/route.ts b/src/app/api/get-theme/route.ts deleted file mode 100644 index 900730d..0000000 --- a/src/app/api/get-theme/route.ts +++ /dev/null @@ -1,30 +0,0 @@ - -import { getThemeFromId } from "@/lib/themes"; - -function getQSParamFromURL( - key: string, - url: string | undefined -): string | null { - if (!url) return ""; - const search = new URL(url).search; - const urlParams = new URLSearchParams(search); - return urlParams.get(key); -} - -function removeUneccessaryKeys(theme: any) { - delete theme["isDarkMode"]; - delete theme["isColorTheme"]; - return theme; -} - -export async function GET(request: Request, response: Response) { - const id = getQSParamFromURL("id", request.url); - if (!id) { - return Response.json({ error: "id is required" }); - } - const theme = await getThemeFromId(id); - if (!theme) { - return Response.json({ error: "theme not found" }); - } - return Response.json(removeUneccessaryKeys(theme)); -} \ No newline at end of file