Haal pakketten-data op via /api/v1/packages i.p.v. hardcoded content
Continuous Integration / config (pull_request) Successful in 3m1s
Continuous Integration / prepare (pull_request) Successful in 1m13s
Continuous Integration / build-production (pull_request) Skipped
Continuous Integration / build (pull_request) Successful in 2m14s
Continuous Integration / test (pull_request) Successful in 1m52s
Continuous Integration / deploy-production (pull_request) Skipped
Deploy / deploy (pull_request) Successful in 43s
Continuous Integration / deploy-test (pull_request) Successful in 44s

PackagesSection gebruikte tot nu toe statische data via een placeholder
query-hook (FR-5). usePackagesQuery haalt nu echt op bij /api/v1/packages
(relatief pad, zelfde domein op test en productie), met een foutmelding
in de UI als het request faalt.

Voegt ook een hand-off-document toe voor de agent die de CMS/API-kant
gaat bouwen: het endpoint-contract, per veld het type/gebruik, en de
huidige statische content als seed-data.
This commit is contained in:
2026-08-01 02:12:31 +02:00
parent 32a5bc0185
commit 7fc06091a5
7 changed files with 181 additions and 19 deletions
@@ -636,3 +636,15 @@
**Context**: Post-workflow follow-up (feature already marked Complete); continues the `feature/analytics_uptime_dashboard` branch, resolving a blocker discovered while the user was setting up the systemd auto-start service on Pi Main. Documentation-only change (no code/build impact); the user still needs to apply the fix on Pi Main.
---
## Post-Completion Follow-up: Packages Section Wired to Real API + CMS/API Hand-off Doc
**Timestamp**: 2026-08-01T00:00:00Z
**User Input**: "Ik wil de data van de pakketten uit een API gaan halen. Kan je dat component aanpassen zodat hij de data uit de api haalt op /api/v1/ van hetzelfde domein (op de test en productie-omgevingen). Bereid de boel voor en maak een hand-off voor de agent die de CMS/API changes moet gaan implementeren zodat die weet wat er nodig is voor de verschillende velden. Wat voor type content erin zit en misschien kort waar die voor gebruikt wordt. Maak een nieuwe feature-branch. Zodra je klaar bent commit en push de changes en maak een PR. Je hebt aan API-token gekregen die je in windows credentials manager hebt gestopt met een script om hem op te halen."
**AI Response**: "Resolved the previously-placeholder `usePackagesQuery.ts` (FR-5) to a real `fetch('/api/v1/packages')` call — a relative path so it resolves against whichever domain serves the app on both `test.slpsoftware.nl` and production. Added an `isError` branch in `PackagesSection.tsx` showing a Dutch error message when the request fails. Kept the static `packages` array in `content.ts` as reference/seed content and updated `PackagesSection.test.tsx` to mock `fetch` (success + error cases) instead of relying on the old synchronous placeholder. Created `construction/react-frontend-app/functional-design/packages-api-handoff.md` documenting the endpoint contract for whoever implements the CMS/API: method/path/same-origin requirement (including the open nginx-proxy gap, since no `/api/` route exists yet on either Pi), full response JSON contract, a field-by-field table (type, content type, required-ness, what each field is used for in the UI) cross-referenced with the existing `domain-entities.md` `PackageCard` entity, and the seed content to migrate. Created feature branch `feature/packages-api-integration` from `origin/master`. Verified `vitest run` (23/23 passed), `eslint .` (0 errors, 2 pre-existing unrelated warnings), and `tsc -b` (clean) before committing."
**Context**: Post-workflow follow-up (feature already marked Complete); addresses a new, explicitly scoped request (frontend API wiring + backend hand-off) rather than resuming an open item from `production-readiness-checklist.md`. Given the clear, bounded scope of the request, this was executed directly (code + hand-off doc + verification) rather than re-running the full inception question-file ceremony. Work done on `feature/packages-api-integration`, to be committed/pushed and opened as a PR per the user's request.
---