Fix booking: use correct BookReservation endpoint + price from selected dates
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:
Claw AI
2026-03-29 21:23:51 +00:00
parent 86b8fc591b
commit f22bc45a4f
2 changed files with 37 additions and 23 deletions

View File

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