Skip to content

Commit

Permalink
req.query can be undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
mathiash98 committed Nov 16, 2023
1 parent 805d2ec commit 1ef10f7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
2 changes: 1 addition & 1 deletion apps/kvarteret/pages/api/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
18 changes: 4 additions & 14 deletions apps/kvarteret/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": false,
Expand All @@ -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"]
}

0 comments on commit 1ef10f7

Please sign in to comment.