Fix NetUP API path: /mw/a → /mw/api (actual server URL from spec)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -23,7 +23,7 @@ const netup: FastifyPluginAsync = async (fastify) => {
|
||||
body?: unknown,
|
||||
): Promise<{ ok: boolean; status: number; data: unknown }> {
|
||||
const base = serverUrl.replace(/\/$/, '')
|
||||
const url = `${base}/mw/a${path}`
|
||||
const url = `${base}/mw/api${path}`
|
||||
const cred = Buffer.from(`${username}:${password}`).toString('base64')
|
||||
|
||||
const res = await fetch(url, {
|
||||
@@ -257,7 +257,7 @@ export async function notifyNetupCheckin(hotelId: string, roomId: string, guestN
|
||||
try {
|
||||
const base = cfg.server_url.replace(/\/$/, '')
|
||||
const cred = Buffer.from(`${cfg.username}:${cfg.password}`).toString('base64')
|
||||
await fetch(`${base}/mw/a/hotel-room/${encodeURIComponent(mapping.netup_room_number)}/check-in`, {
|
||||
await fetch(`${base}/mw/api/hotel-room/${encodeURIComponent(mapping.netup_room_number)}/check-in`, {
|
||||
method: 'POST',
|
||||
headers: { Authorization: `Basic ${cred}`, 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
@@ -288,7 +288,7 @@ export async function notifyNetupCheckout(hotelId: string, roomId: string) {
|
||||
try {
|
||||
const base = cfg.server_url.replace(/\/$/, '')
|
||||
const cred = Buffer.from(`${cfg.username}:${cfg.password}`).toString('base64')
|
||||
await fetch(`${base}/mw/a/hotel-room/${encodeURIComponent(mapping.netup_room_number)}/check-out`, {
|
||||
await fetch(`${base}/mw/api/hotel-room/${encodeURIComponent(mapping.netup_room_number)}/check-out`, {
|
||||
method: 'POST',
|
||||
headers: { Authorization: `Basic ${cred}` },
|
||||
signal: AbortSignal.timeout(6000),
|
||||
|
||||
Reference in New Issue
Block a user