refactor: renamed API dirs

This commit is contained in:
2024-02-08 13:27:28 +01:00
parent 8703decb91
commit 3bd487d126
3 changed files with 2 additions and 2 deletions

View File

@@ -0,0 +1,14 @@
import { fetchAllLocations } from '@/app/lib/actions/locationActions';
import type { NextApiRequest } from 'next'
import { NextResponse } from 'next/server';
export const GET = async (
req: NextApiRequest,
) => {
// get year from query params
const url = new URL(req.url as string);
const year = parseInt(url.searchParams.get('year') as string, 10);
const locations = await fetchAllLocations(year);
return NextResponse.json({ locations });
}