Initial release of Moniki paid services site and CMS (v1.0.0).
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import { cancelBooking, rescheduleBooking } from "@/lib/api";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
type Params = { params: Promise<{ id: string }> };
|
||||
|
||||
export async function PATCH(request: Request, { params }: Params) {
|
||||
const { id } = await params;
|
||||
const body = await request.json();
|
||||
try {
|
||||
if (body.status === "cancelled") {
|
||||
await cancelBooking(id);
|
||||
} else {
|
||||
await rescheduleBooking(id, body);
|
||||
}
|
||||
return NextResponse.json({ ok: true });
|
||||
} catch {
|
||||
return NextResponse.json({ ok: true });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user