Skip to content

Commit

Permalink
fix(overige-objecten-api): fix processData function
Browse files Browse the repository at this point in the history
  • Loading branch information
AliKdhim87 authored and Robbert committed Dec 17, 2024
1 parent ed4d2a4 commit a86232d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/ten-steaks-cover.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@frameless/overige-objecten-api": patch
---

Los het probleem op dat optreedt wanneer er geen gegevens beschikbaar zijn in kennisartikelen.
4 changes: 2 additions & 2 deletions apps/overige-objecten-api/src/utils/processData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ interface ProcessDataParams {
}

export const processData = ({ data, priceData }: ProcessDataParams) =>
data.map((item: any) => {
data?.map((item: any) => {
if (item.component === 'ComponentComponentsUtrechtRichText') {
return mapContentByCategory(
item.categorie,
Expand All @@ -36,7 +36,7 @@ export const processData = ({ data, priceData }: ProcessDataParams) =>
return mappedContent;
}
if (item.component === 'ComponentComponentsUtrechtImage') {
const imageUrl = item.imageData.data.attributes.url;
const imageUrl = item?.imageData?.data?.attributes.url;

if (!imageUrl) return {};
if (!item.categorie) return {};
Expand Down

0 comments on commit a86232d

Please sign in to comment.