removed legacy API routes
This commit is contained in:
@@ -1,9 +0,0 @@
|
|||||||
import { fetchAvailableYears } from '@/app/lib/actions/monthActions';
|
|
||||||
import { NextResponse } from 'next/server';
|
|
||||||
|
|
||||||
export async function GET(request: Request) {
|
|
||||||
|
|
||||||
const availableYears = await fetchAvailableYears();
|
|
||||||
|
|
||||||
return NextResponse.json({ availableYears });
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
import { fetchLocationById } from '@/app/lib/actions/locationActions';
|
|
||||||
import { NextResponse } from 'next/server';
|
|
||||||
|
|
||||||
export const GET = async (
|
|
||||||
req: Request,
|
|
||||||
) => {
|
|
||||||
const url = new URL(req.url as string);
|
|
||||||
const locationId = url.searchParams.get('id');
|
|
||||||
const location = await fetchLocationById(locationId as string);
|
|
||||||
|
|
||||||
return NextResponse.json({ location });
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
import { fetchAllLocations } from '@/app/lib/actions/locationActions';
|
|
||||||
import { NextResponse } from 'next/server';
|
|
||||||
|
|
||||||
export const GET = async (
|
|
||||||
req: Request,
|
|
||||||
) => {
|
|
||||||
// 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 });
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user