From 2f2a1d23659a045fb369f2634c87849378a07efb 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 | 1 + govtool/frontend/src/models/metadataValidation.ts | 2 +- govtool/frontend/src/utils/mapDtoToProposal.ts | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 939d8fb64..5413838d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ changes. - Fix incorrect documentation link for "Learn More" button on proposal [Issue 1877](https://github.com/IntersectMBO/govtool/issues/1877) - Fix getVotes sql to query time from vote tx instead of govAaction tx [Issue 1925](https://github.com/IntersectMBO/govtool/issues/1925) +- 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, };