chore: Update next.config to export output
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
/** @type {import('next').NextConfig} */
|
/** @type {import('next').NextConfig} */
|
||||||
const nextConfig = {
|
const nextConfig = {
|
||||||
//output: 'export',
|
output: 'export',
|
||||||
images: {
|
images: {
|
||||||
remotePatterns: [
|
remotePatterns: [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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));
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user