This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import { lookupVehicle } from "@/lib/vehicle-lookup";
|
||||
import { errorResponse, jsonResponse } from "@/lib/api-helpers";
|
||||
|
||||
export async function GET(req: Request) {
|
||||
const { searchParams } = new URL(req.url);
|
||||
const reg = searchParams.get("reg")?.trim();
|
||||
if (!reg) return errorResponse("reg is required");
|
||||
|
||||
const result = await lookupVehicle(reg);
|
||||
return jsonResponse(result);
|
||||
}
|
||||
Reference in New Issue
Block a user