Fix: rental booking save (date comparison), add DB guest search in rental modal

- BookingCalendar: normalize date comparison with .slice(0,10) to fix PostgreSQL DATE ISO format mismatch
- CalendarPage: show alert on rental booking save failure
- RentalBookingModal: add debounced DB guest search (api.guests.list) with 300ms delay
- RentalBookingModal: combine booking suggestions + DB results in unified dropdown
- Pass slug prop to RentalBookingModal for API access

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-21 16:45:37 +03:00
parent 68c9caf46f
commit dbccc59dfc
3 changed files with 59 additions and 13 deletions

View File

@@ -159,6 +159,8 @@ export function CalendarPage() {
setRentalBookings(prev => [...prev, created])
} catch (err) {
console.error('Failed to create rental booking:', err)
const msg = err instanceof Error ? err.message : 'Ошибка сохранения аренды'
alert(msg)
}
}, [slug])