Fix: drag booking passes roomId to API; checked_out rooms available for new booking; remove time-based theme text

This commit is contained in:
2026-03-21 00:22:03 +03:00
parent fd804926e4
commit 75d7d6aa08
4 changed files with 4 additions and 3 deletions

View File

@@ -42,7 +42,7 @@ function isConflict(bookings: Booking[], roomId: string, checkIn: string, checkO
return bookings.some(b => return bookings.some(b =>
b.roomId === roomId && b.roomId === roomId &&
b.id !== excludeId && 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, b.checkIn < checkOut && b.checkOut > checkIn,
) )
} }

View File

@@ -257,7 +257,7 @@ export function Topbar({ onMenuToggle, title }: TopbarProps) {
</div> </div>
{/* Theme toggle */} {/* Theme toggle */}
<button onClick={toggle} className="btn-ghost p-2" title={mode === 'light' ? 'Светлая тема' : mode === 'dark' ? 'Тёмная тема' : 'Авто (по времени)'}> <button onClick={toggle} className="btn-ghost p-2" title={mode === 'light' ? 'Светлая тема' : mode === 'dark' ? 'Тёмная тема' : 'Авто (системная тема)'}>
{mode === 'light' ? <Moon size={18} /> : mode === 'dark' ? <Sun size={18} /> : <Monitor size={18} />} {mode === 'light' ? <Moon size={18} /> : mode === 'dark' ? <Sun size={18} /> : <Monitor size={18} />}
</button> </button>

View File

@@ -82,6 +82,7 @@ export function CalendarPage() {
const handleUpdate = async (id: string, data: Partial<Booking>) => { const handleUpdate = async (id: string, data: Partial<Booking>) => {
try { try {
const updated = await api.bookings.update(slug, id, { const updated = await api.bookings.update(slug, id, {
roomId: data.roomId,
guestName: data.guestName, guestEmail: data.guestEmail, guestName: data.guestName, guestEmail: data.guestEmail,
checkIn: data.checkIn, checkOut: data.checkOut, checkIn: data.checkIn, checkOut: data.checkOut,
adults: data.adults, children: data.children, adults: data.adults, children: data.children,

View File

@@ -373,7 +373,7 @@ export function SettingsPage() {
{([ {([
{ id: 'light', label: 'Светлая', desc: null }, { id: 'light', label: 'Светлая', desc: null },
{ id: 'dark', label: 'Тёмная', desc: null }, { id: 'dark', label: 'Тёмная', desc: null },
{ id: 'auto', label: 'Авто', desc: 'Светлая 7:0022:00, тёмная ночью' }, { id: 'auto', label: 'Авто', desc: 'Следует системной теме устройства' },
] as const).map(t => ( ] as const).map(t => (
<button <button
key={t.id} key={t.id}