Beschrijving
Update PDC Frontend (afhankelijk van PDC Dashboard) voor de nieuwe
Strapi v5 API response format.
ℹ️ Context
Strapi v5 verwijderde het data/attributes envelope.
Strapi v4 response:
{
"data": {
"id": 1,
"attributes": {
"title": "Hello",
"content": "World"
}
}
}
Strapi v5 response:
{
"id": 1,
"title": "Hello",
"content": "World"
}
Je code moet deze flattened format gebruiken.
Acceptance Criteria
Taken
Stap 1: API calls auditen
Stap 2: Response format aanpassingen
For each API call, change:
// VOOR (Strapi v4)
const response = await fetch('/api/articles');
const articles = response.data.map(article => article.attributes);
// NA (Strapi v5)
const response = await fetch('/api/articles');
const articles = response; // Already flattened
Stap 3: Data destructuring
// VOOR
const { data } = await fetchArticle(id);
const { title, content } = data.attributes;
// NA
const article = await fetchArticle(id);
const { title, content } = article;
Stap 4: GraphQL updates (if applicable)
If you use GraphQL:
Stap 5: Environment variables
Stap 6: Build testen
pnpm --filter @frameless/pdc-frontend build
Stap 7: Dev server testen
pnpm --filter @frameless/catalogi-data dev
# Check:
# - Pages load
# - No console errors
# - Data fetching works (with dev Strapi v5 running)
Stap 8: API contract testing
Expected Result
✅ PDC Frontend WORKS with Strapi v5 API
✅ PDC Dashboard WORKS
❌ Dashboard 2 still being migrated or just finished
❌ Frontend 2 not yet updated (will be next)
❌ Services not yet updated
Beschrijving
Update PDC Frontend (afhankelijk van PDC Dashboard) voor de nieuwe
Strapi v5 API response format.
ℹ️ Context
Strapi v5 verwijderde het
data/attributesenvelope.Strapi v4 response:
{ "data": { "id": 1, "attributes": { "title": "Hello", "content": "World" } } }Strapi v5 response:
{ "id": 1, "title": "Hello", "content": "World" }Je code moet deze flattened format gebruiken.
Acceptance Criteria
Taken
Stap 1: API calls auditen
Stap 2: Response format aanpassingen
For each API call, change:
Stap 3: Data destructuring
Stap 4: GraphQL updates (if applicable)
If you use GraphQL:
Stap 5: Environment variables
Stap 6: Build testen
Stap 7: Dev server testen
Stap 8: API contract testing
Expected Result
✅ PDC Frontend WORKS with Strapi v5 API
✅ PDC Dashboard WORKS
❌ Dashboard 2 still being migrated or just finished
❌ Frontend 2 not yet updated (will be next)
❌ Services not yet updated