futher booking stuff

This commit is contained in:
PxlLoewe
2025-09-20 22:16:23 +02:00
parent ba027957ce
commit cf199150fe
8 changed files with 50 additions and 58 deletions

View File

@@ -18,9 +18,10 @@ export const getBookingsAPI = async (filter: Prisma.BookingWhereInput) => {
return res.data;
};
export const createBookingAPI = async (booking: Prisma.BookingCreateInput) => {
export const createBookingAPI = async (booking: Omit<Prisma.BookingCreateInput, "User">) => {
const response = await axios.post("/api/bookings", booking);
if (response.status !== 201) {
console.error("Error creating booking:", response);
throw new Error("Failed to create booking");
}
return response.data;