From 75d7d6aa08c755330ad375681cfad2bc441d5885 Mon Sep 17 00:00:00 2001 From: HotelSync Date: Sat, 21 Mar 2026 00:22:03 +0300 Subject: [PATCH] Fix: drag booking passes roomId to API; checked_out rooms available for new booking; remove time-based theme text --- src/components/bookings/BookingModal.tsx | 2 +- src/components/layout/Topbar.tsx | 2 +- src/pages/CalendarPage.tsx | 1 + src/pages/SettingsPage.tsx | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/bookings/BookingModal.tsx b/src/components/bookings/BookingModal.tsx index 8d696d1..b6fef56 100644 --- a/src/components/bookings/BookingModal.tsx +++ b/src/components/bookings/BookingModal.tsx @@ -42,7 +42,7 @@ function isConflict(bookings: Booking[], roomId: string, checkIn: string, checkO return bookings.some(b => b.roomId === roomId && b.id !== excludeId && - b.status !== 'cancelled' && b.status !== 'no_show' && + b.status !== 'cancelled' && b.status !== 'no_show' && b.status !== 'checked_out' && b.checkIn < checkOut && b.checkOut > checkIn, ) } diff --git a/src/components/layout/Topbar.tsx b/src/components/layout/Topbar.tsx index f3feec3..6db9018 100644 --- a/src/components/layout/Topbar.tsx +++ b/src/components/layout/Topbar.tsx @@ -257,7 +257,7 @@ export function Topbar({ onMenuToggle, title }: TopbarProps) { {/* Theme toggle */} - diff --git a/src/pages/CalendarPage.tsx b/src/pages/CalendarPage.tsx index eccd6bd..f349c1c 100644 --- a/src/pages/CalendarPage.tsx +++ b/src/pages/CalendarPage.tsx @@ -82,6 +82,7 @@ export function CalendarPage() { const handleUpdate = async (id: string, data: Partial) => { try { const updated = await api.bookings.update(slug, id, { + roomId: data.roomId, guestName: data.guestName, guestEmail: data.guestEmail, checkIn: data.checkIn, checkOut: data.checkOut, adults: data.adults, children: data.children, diff --git a/src/pages/SettingsPage.tsx b/src/pages/SettingsPage.tsx index 3e80760..913bfb2 100644 --- a/src/pages/SettingsPage.tsx +++ b/src/pages/SettingsPage.tsx @@ -373,7 +373,7 @@ export function SettingsPage() { {([ { id: 'light', label: 'Светлая', desc: null }, { id: 'dark', label: 'Тёмная', desc: null }, - { id: 'auto', label: 'Авто', desc: 'Светлая 7:00–22:00, тёмная ночью' }, + { id: 'auto', label: 'Авто', desc: 'Следует системной теме устройства' }, ] as const).map(t => (