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
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:
@@ -2,7 +2,7 @@ import { usePackagesQuery } from '../hooks/usePackagesQuery';
|
||||
import { PackageCard } from './PackageCard';
|
||||
|
||||
export function PackagesSection() {
|
||||
const { data: packages, isLoading } = usePackagesQuery();
|
||||
const { data: packages, isLoading, isError } = usePackagesQuery();
|
||||
|
||||
return (
|
||||
<section
|
||||
@@ -23,9 +23,13 @@ export function PackagesSection() {
|
||||
</p>
|
||||
</div>
|
||||
<div className="grid grid-cols-1 gap-[22px] sm:grid-cols-3" data-testid="packages-grid">
|
||||
{isLoading || !packages
|
||||
? null
|
||||
: packages.map((pkg) => <PackageCard key={pkg.id} pkg={pkg} />)}
|
||||
{isError ? (
|
||||
<p className="col-span-full text-center text-muted" data-testid="packages-error">
|
||||
Pakketten konden niet worden geladen. Probeer het later opnieuw.
|
||||
</p>
|
||||
) : isLoading || !packages ? null : (
|
||||
packages.map((pkg) => <PackageCard key={pkg.id} pkg={pkg} />)
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user