chore: Update next.config to export output

This commit is contained in:
mauro-balades
2024-08-27 16:35:21 +02:00
parent a3cf78d83a
commit 8f95457096
2 changed files with 1 additions and 31 deletions

View File

@@ -1,6 +1,6 @@
/** @type {import('next').NextConfig} */ /** @type {import('next').NextConfig} */
const nextConfig = { const nextConfig = {
//output: 'export', output: 'export',
images: { images: {
remotePatterns: [ remotePatterns: [
{ {

View File

@@ -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));
}