From 73ce16ee74300fb2b38751dfb6f0389c5af14dd3 Mon Sep 17 00:00:00 2001 From: "groombook-engineer[bot]" <269742240+groombook-engineer[bot]@users.noreply.github.com> Date: Mon, 30 Mar 2026 01:54:11 +0000 Subject: [PATCH] fix: billing portal session header and response format mismatch (#168) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes GRO-261 — billing portal session header mismatch and response format bug. - x-session-id → X-Impersonation-Session-Id in BillingPayments.tsx and Dashboard.tsx - Handle bare array response from /api/portal/invoices Co-Authored-By: Paperclip --- apps/web/src/portal/sections/BillingPayments.tsx | 4 ++-- apps/web/src/portal/sections/Dashboard.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/web/src/portal/sections/BillingPayments.tsx b/apps/web/src/portal/sections/BillingPayments.tsx index bc110e3..015da3c 100644 --- a/apps/web/src/portal/sections/BillingPayments.tsx +++ b/apps/web/src/portal/sections/BillingPayments.tsx @@ -46,7 +46,7 @@ export function BillingPayments({ sessionId, readOnly }: BillingPaymentsProps) { try { const response = await fetch("/api/portal/invoices", { headers: { - "x-session-id": sessionId, + "X-Impersonation-Session-Id": sessionId, }, }); @@ -55,7 +55,7 @@ export function BillingPayments({ sessionId, readOnly }: BillingPaymentsProps) { } const data = await response.json(); - setInvoices(data.invoices || []); + setInvoices(Array.isArray(data) ? data : data.invoices || []); setPaymentMethods(data.paymentMethods || []); setPackages(data.packages || []); } catch (err) { diff --git a/apps/web/src/portal/sections/Dashboard.tsx b/apps/web/src/portal/sections/Dashboard.tsx index 5820365..43abe5c 100644 --- a/apps/web/src/portal/sections/Dashboard.tsx +++ b/apps/web/src/portal/sections/Dashboard.tsx @@ -92,7 +92,7 @@ export function Dashboard({ try { const headers = { - "x-session-id": sessionId, + "X-Impersonation-Session-Id": sessionId, }; const [appointmentsRes, petsRes, invoicesRes, brandingRes] = await Promise.all([