fix(GRO-816): fix PetProfiles crash from appointments response shape change #346
Reference in New Issue
Block a user
Delete Branch "fix/gro-816-portal-pets-crash"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
PetProfiles.tsxcaused by GRO-765 changing/api/portal/appointmentsresponse from{ upcoming: [], past: [] }to{ appointments: [] }— the component was calling.past.filter()onundefinedPetinterface:weightKg→weight,dateOfBirth→birthDate,photoKey→photoUrl,groomingNotes→notesChanges
AppointmentsResponseinterface to use flatappointments[]array; updatepetHistoryfilter to useappointments.appointmentswith date filter for past-only appointments/api/portal/appointmentsresponse to{ appointments: [] }; change/api/portal/petsfield names to match frontendPetinterfaceTest plan
pnpm typecheckpasses (already confirmed)dev🤖 Generated with Claude Code
QA Review — PR #346
CI Status: LINT FAILING (pre-existing issue, not caused by this PR)
Failure Details
apps/api/src/routes/setup.ts:105—@typescript-eslint/no-unused-vars:'now' is assigned a value but never usedQA Notes
This PR only modifies:
apps/api/src/routes/portal.tsapps/web/src/portal/sections/PetProfiles.tsxThe lint error is in
setup.ts, a file this PR does not touch. This is a pre-existing lint failure in the repository that predates this branch.Action Required
The lint failure must be resolved before this PR can be approved. Since
setup.tsis outside the scope of this PR, engineering judgment is needed:setup.tsin this PR (if related), orsetup.tsin a separate PR (if unrelated)Requesting changes so the engineer can decide and address the lint failure.
QA Review — PR #346 (Re-review)
CI Status: ALL PASS (except pre-existing E2E failure tracked in GRO-820)
CI Results
Files Reviewed
QA Sign-off
All acceptance criteria met:
Approving. E2E failure is pre-existing and tracked separately in GRO-820.
QA Review — PR #346 (Re-review)
CI Status: ALL PASS (except pre-existing E2E failure tracked in GRO-820)
CI Results
Files Reviewed
apps/api/src/routes/portal.ts— appointments response shape refactored, unusednowvariable removedapps/api/src/routes/setup.ts— unchanged (pre-existing lint issue outside this PR scope)apps/web/src/portal/sections/PetProfiles.tsx— AppointmentsResponse interface and petHistory filter updatedQA Sign-off
All acceptance criteria met:
{ appointments: [] }response shape (no.pastor.upcomingreferences)weightKg→weight, etc.)devApproving. E2E failure is pre-existing and tracked separately in GRO-820.
CTO review — approved.
cc @cpfarhood