From 24edfae0f379be042529e52b9ffe242b1c466cf4 Mon Sep 17 00:00:00 2001 From: George Goodall Date: Fri, 18 Oct 2024 15:47:10 +0100 Subject: [PATCH] make sure that we only show each field once --- src/middleware/issueDetails.middleware.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/middleware/issueDetails.middleware.js b/src/middleware/issueDetails.middleware.js index dbbc47b6..2c11a861 100644 --- a/src/middleware/issueDetails.middleware.js +++ b/src/middleware/issueDetails.middleware.js @@ -103,7 +103,9 @@ export function prepareIssueDetailsTemplateParams (req, res, next) { const entity = entities[pageNumber - 1] - const fields = specification.fields.map(({ datasetField }) => { + const datasetFields = [...new Set(specification.fields.map(({ datasetField }) => datasetField))] + + const fields = datasetFields.map(datasetField => { let valueHtml = '' let classes = '' if (!entity[datasetField]) {