From 0128d46a3248b71c98686acb2636804abd62395f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Dere=C5=BEi=C4=87?= Date: Thu, 8 Feb 2024 14:48:49 +0100 Subject: [PATCH] fixing typescript errors --- app/api/locations/by-id/route.ts | 3 +-- app/api/locations/in-year/route.ts | 3 +-- app/location/[id]/add/LocationAddPage.tsx | 2 +- app/ui/MonthCard.tsx | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/api/locations/by-id/route.ts b/app/api/locations/by-id/route.ts index 605b5d6..0696906 100644 --- a/app/api/locations/by-id/route.ts +++ b/app/api/locations/by-id/route.ts @@ -1,9 +1,8 @@ import { fetchLocationById } from '@/app/lib/actions/locationActions'; -import type { NextApiRequest } from 'next' import { NextResponse } from 'next/server'; export const GET = async ( - req: NextApiRequest, + req: Request, ) => { const url = new URL(req.url as string); const locationId = url.searchParams.get('id'); diff --git a/app/api/locations/in-year/route.ts b/app/api/locations/in-year/route.ts index 21179d9..3a68065 100644 --- a/app/api/locations/in-year/route.ts +++ b/app/api/locations/in-year/route.ts @@ -1,9 +1,8 @@ import { fetchAllLocations } from '@/app/lib/actions/locationActions'; -import type { NextApiRequest } from 'next' import { NextResponse } from 'next/server'; export const GET = async ( - req: NextApiRequest, + req: Request, ) => { // get year from query params const url = new URL(req.url as string); diff --git a/app/location/[id]/add/LocationAddPage.tsx b/app/location/[id]/add/LocationAddPage.tsx index a099506..865f06f 100644 --- a/app/location/[id]/add/LocationAddPage.tsx +++ b/app/location/[id]/add/LocationAddPage.tsx @@ -3,6 +3,6 @@ import { LocationEditForm } from '@/app/ui/LocationEditForm'; import { YearMonth } from '@/app/lib/db-types'; -export default async function LocationAddPage({ yearMonth }: { yearMonth:YearMonth }) { +export default function LocationAddPage({ yearMonth }: { yearMonth:YearMonth }) { return (); } \ No newline at end of file diff --git a/app/ui/MonthCard.tsx b/app/ui/MonthCard.tsx index d9a3829..3861fb2 100644 --- a/app/ui/MonthCard.tsx +++ b/app/ui/MonthCard.tsx @@ -27,7 +27,7 @@ export const MonthCard:FC = ({ yearMonth, children, monthlyExpen // if the element i selected > scroll it into view elRef.current.scrollIntoView({ behavior: 'smooth', block: 'center' }); } - }, []); + }, [expanded]); return(