LocationEditForm: migrated to client-side rendering

This commit is contained in:
2024-02-08 13:50:48 +01:00
parent 3bd487d126
commit 0bb4c12061
4 changed files with 71 additions and 22 deletions

View File

@@ -0,0 +1,13 @@
import { fetchLocationById } from '@/app/lib/actions/locationActions';
import type { NextApiRequest } from 'next'
import { NextResponse } from 'next/server';
export const GET = async (
req: NextApiRequest,
) => {
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 });
}