LocationEditForm: migrated to client-side rendering
This commit is contained in:
13
app/api/locations/by-id/route.ts
Normal file
13
app/api/locations/by-id/route.ts
Normal 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 });
|
||||
}
|
||||
Reference in New Issue
Block a user