From 2af23264e6b9efa7fd87308fe66c25f30b5d88dc Mon Sep 17 00:00:00 2001 From: Joanna Dyczka Date: Wed, 4 Sep 2024 16:21:43 +0200 Subject: [PATCH] [#1924] map references from validation service to format expected by FE --- CHANGELOG.md | 2 +- govtool/frontend/src/models/metadataValidation.ts | 2 +- govtool/frontend/src/utils/mapDtoToProposal.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0eebd1590..d54addb5b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,7 @@ changes. ### Fixed -- +- Map references from validation service to format expected by FE [Issue 1924](https://github.com/IntersectMBO/govtool/issues/1924) ### Changed diff --git a/govtool/frontend/src/models/metadataValidation.ts b/govtool/frontend/src/models/metadataValidation.ts index e55808399..e93ab44da 100644 --- a/govtool/frontend/src/models/metadataValidation.ts +++ b/govtool/frontend/src/models/metadataValidation.ts @@ -31,6 +31,6 @@ export type ProposalMetadata = { abstract?: string; motivation?: string; rationale?: string; - references?: string[]; + references?: Reference[]; title?: string; }; diff --git a/govtool/frontend/src/utils/mapDtoToProposal.ts b/govtool/frontend/src/utils/mapDtoToProposal.ts index 0530e059a..4c118c294 100644 --- a/govtool/frontend/src/utils/mapDtoToProposal.ts +++ b/govtool/frontend/src/utils/mapDtoToProposal.ts @@ -16,7 +16,7 @@ export const mapDtoToProposal = async ( abstract: validationResponse.metadata?.abstract, motivation: validationResponse.metadata?.motivation, rationale: validationResponse.metadata?.rationale, - references: validationResponse.metadata?.references, + references: validationResponse.metadata?.references?.map(({ uri }) => uri), metadataStatus: validationResponse.status || null, metadataValid: validationResponse.valid, };