14 lines
419 B
TypeScript
14 lines
419 B
TypeScript
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 });
|
|
}
|