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