fixing typescript errors

This commit is contained in:
2024-02-08 14:48:49 +01:00
parent 568509fc41
commit 0128d46a32
4 changed files with 4 additions and 6 deletions

View File

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

View File

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

View File

@@ -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 (<LocationEditForm yearMonth={yearMonth} />);
}

View File

@@ -27,7 +27,7 @@ export const MonthCard:FC<MonthCardProps> = ({ yearMonth, children, monthlyExpen
// if the element i selected > scroll it into view
elRef.current.scrollIntoView({ behavior: 'smooth', block: 'center' });
}
}, []);
}, [expanded]);
return(
<div className="collapse collapse-plus bg-base-200 my-1" ref={elRef}>