Falsche Zeitzone bei Buchungen und HTTP status codes als Fehlermeldung behoben

This commit is contained in:
PxlLoewe
2025-10-01 22:23:27 +02:00
parent dc4a3ab4d8
commit ada041bd4a
4 changed files with 64 additions and 44 deletions

View File

@@ -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;
};