Fix booking: use correct BookReservation endpoint + price from selected dates
All checks were successful
Build frontend / build (push) Successful in 38s
All checks were successful
Build frontend / build (push) Successful in 38s
- Fixed endpoint: /Reservations/BookReservation/book (was /Reservations/Book) - bookReservation now takes (propertyId, startDate, endDate) params - Pricing updates dynamically based on selected date range - Deposit read from API response instead of hardcoded - Removed demo fallback that always showed success
This commit is contained in:
@ -149,10 +149,11 @@ export async function checkAvailability(propertyId, fromDate = null, toDate = nu
|
||||
return apiFetch(`/Reservations/GetAvailable/${propertyId}${query ? `?${query}` : ''}`);
|
||||
}
|
||||
|
||||
export async function bookReservation(data) {
|
||||
return apiFetch('/Reservations/Book', {
|
||||
export async function bookReservation(propertyId, startDate, endDate) {
|
||||
console.log('[API] Booking reservation:', { propertyId, startDate, endDate });
|
||||
return apiFetch('/Reservations/BookReservation/book', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(data),
|
||||
body: JSON.stringify({ propertyId, startDate, endDate }),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user