diff --git a/apps/kvarteret/pages/api/events.ts b/apps/kvarteret/pages/api/events.ts index 625573f..f3da425 100644 --- a/apps/kvarteret/pages/api/events.ts +++ b/apps/kvarteret/pages/api/events.ts @@ -8,7 +8,7 @@ export default async function handler( res: NextApiResponse ) { // ... - const search = req.query.search.toString(); + const search = req.query?.search?.toString(); const events = await getEventsAfter("no", new Date()); const mapped = events; diff --git a/apps/kvarteret/tsconfig.json b/apps/kvarteret/tsconfig.json index 7c57f18..1563f3e 100644 --- a/apps/kvarteret/tsconfig.json +++ b/apps/kvarteret/tsconfig.json @@ -1,11 +1,7 @@ { "compilerOptions": { "target": "es5", - "lib": [ - "dom", - "dom.iterable", - "esnext" - ], + "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true, "strict": false, @@ -19,12 +15,6 @@ "isolatedModules": true, "jsx": "preserve" }, - "include": [ - "next-env.d.ts", - "**/*.ts", - "**/*.tsx" - ], - "exclude": [ - "node_modules" - ] -} + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], + "exclude": ["node_modules"] +}