forked from Somnia/SomniaRoomsApp
Booking lifecycle:
- Create bookings :)
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import { NewBooking, NewBookingResponse } from "@/model/Bookings";
|
||||
import { fetcherWithFilter } from "./backend";
|
||||
|
||||
export async function APISendCreateBooking(bookingData: NewBooking | null) {
|
||||
|
||||
if (!bookingData) {
|
||||
return {
|
||||
bookingResponse: null,
|
||||
isError: true
|
||||
}
|
||||
}
|
||||
|
||||
const rs = await fetcherWithFilter<NewBookingResponse>("/api/booking/create", bookingData);
|
||||
|
||||
return {
|
||||
bookingResponse: rs,
|
||||
isError: false
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user