Add customer management
This commit is contained in:
14
internal_frontend/app/api/customers/route.ts
Normal file
14
internal_frontend/app/api/customers/route.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import {NextRequest, NextResponse} from "next/server";
|
||||
import {serverCall} from "@/lib/api/serverCall";
|
||||
|
||||
export async function GET() {
|
||||
const data = await serverCall("/customers", "GET");
|
||||
const customers = await data.json();
|
||||
return NextResponse.json(customers);
|
||||
}
|
||||
|
||||
export async function POST(req: NextRequest) {
|
||||
const body = await req.json()
|
||||
const result = await serverCall("/customers", "POST", body);
|
||||
return NextResponse.json(result.json());
|
||||
}
|
||||
Reference in New Issue
Block a user