Falsche Zeitzone bei Buchungen und HTTP status codes als Fehlermeldung behoben
This commit is contained in:
@@ -20,10 +20,12 @@ export const getBookingsAPI = async (filter: Prisma.BookingWhereInput) => {
|
||||
|
||||
export const createBookingAPI = async (booking: Omit<Prisma.BookingCreateInput, "User">) => {
|
||||
const response = await axios.post("/api/bookings", booking);
|
||||
console.log("Response from createBookingAPI:", response);
|
||||
if (response.status !== 201) {
|
||||
console.error("Error creating booking:", response);
|
||||
throw new Error("Failed to create booking");
|
||||
}
|
||||
console.log("Booking created:", response.data);
|
||||
return response.data;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user