fix(web): add X-Impersonation-Session-Id header to portal API calls

This commit also includes GRO-287 fixes:
- PasswordChange: add stateful form with password-match validation
- ReportCards: replace window.location.reload() with refetch via useRef

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Barkley Trimsworth
2026-03-30 10:58:54 +00:00
parent 8437dc43dc
commit 5aad2da55a
4 changed files with 87 additions and 34 deletions
@@ -118,7 +118,7 @@ export const AppointmentsSection: React.FC<AppointmentsSectionProps> = ({ sessio
try {
const response = await fetch('/api/portal/appointments', {
headers: { Authorization: `Bearer ${sessionId}` },
headers: { "X-Impersonation-Session-Id": sessionId ?? "" },
});
if (response.ok) {
@@ -744,10 +744,10 @@ function BookingFlow({ onClose, sessionId }: BookingFlowProps) {
try {
const [petsRes, servicesRes] = await Promise.all([
fetch('/api/portal/pets', {
headers: { Authorization: `Bearer ${sessionId}` },
headers: { "X-Impersonation-Session-Id": sessionId ?? "" },
}),
fetch('/api/portal/services', {
headers: { Authorization: `Bearer ${sessionId}` },
headers: { "X-Impersonation-Session-Id": sessionId ?? "" },
}),
]);