Fix NetUP settings not loading: snake_case → camelCase (transformKeys)

req() auto-converts server_url→serverUrl, default_language→defaultLanguage,
netup_room_number→netupRoomNumber. Fixed both type declarations and component reads.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-18 18:39:01 +03:00
parent cc5f9c18d3
commit 05d0c94a9a
2 changed files with 8 additions and 8 deletions

View File

@@ -269,7 +269,7 @@ export const api = {
// ── NetUP IPTV ────────────────────────────────────────────────────────────
netup: {
getSettings: (slug: string) =>
req<{ server_url: string; username: string; password: string; default_language: string; enabled: boolean }>(
req<{ serverUrl: string; username: string; password: string; defaultLanguage: string; enabled: boolean }>(
'GET', `/api/hotels/${slug}/netup/settings`),
saveSettings: (slug: string, data: { server_url: string; username: string; password?: string; default_language: string; enabled: boolean }) =>
@@ -279,7 +279,7 @@ export const api = {
req<{ ok: boolean; message: string }>('POST', `/api/hotels/${slug}/netup/test`),
getRoomMappings: (slug: string) =>
req<{ id: string; number: string; type: string; netup_room_number: string }[]>(
req<{ id: string; number: string; type: string; netupRoomNumber: string }[]>(
'GET', `/api/hotels/${slug}/netup/rooms`),
saveRoomMappings: (slug: string, mappings: { pms_room_id: string; netup_room_number: string }[]) =>