Skip to content

Commit

Permalink
Fix annotations viewpoint with no features
Browse files Browse the repository at this point in the history
  • Loading branch information
dtrucs committed Oct 10, 2024
1 parent e2af2cf commit 54a2c67
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions frontend/src/modules/viewPoint/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@ export const adaptViewPoints = async (
return {
annotations: {
...viewpoint.annotations,
features: viewpoint.annotations.features.map(feature => ({
...feature,
properties: {
...feature.properties,
category: categories?.[feature.properties?.category] || null,
},
})),
features:
viewpoint.annotations.features?.map(feature => ({
...feature,
properties: {
...feature.properties,
category: categories?.[feature.properties?.category] || null,
},
})) ?? [],
},
id: String(viewpoint.id),
author: viewpoint.author,
Expand Down

0 comments on commit 54a2c67

Please sign in to comment.