removed legacy API routes

This commit is contained in:
2024-02-09 09:44:49 +01:00
parent 9609f7da54
commit 432952f57c
3 changed files with 0 additions and 34 deletions

View File

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

View File

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

View File

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