diff --git a/src/middleware/datasetOverview.middleware.js b/src/middleware/datasetOverview.middleware.js index df484c9ed..816de9d08 100644 --- a/src/middleware/datasetOverview.middleware.js +++ b/src/middleware/datasetOverview.middleware.js @@ -45,7 +45,7 @@ const fetchEntityCount = fetchOne({ }) export const prepareDatasetOverviewTemplateParams = (req, res, next) => { - const { orgInfo, specification, columnSummary, entityCount, sources, dataset } = req + const { orgInfo, specification, columnSummary, entityCount, sources, dataset, issues } = req const mappingFields = columnSummary[0].mapping_field?.split(';') ?? [] const nonMappingFields = columnSummary[0].non_mapping_field?.split(';') ?? [] @@ -89,6 +89,7 @@ export const prepareDatasetOverviewTemplateParams = (req, res, next) => { req.templateParams = { organisation: orgInfo, dataset, + issueCount: issues.length ?? 0, stats: { numberOfFieldsSupplied: numberOfFieldsSupplied ?? 0, numberOfFieldsMatched: numberOfFieldsMatched ?? 0, diff --git a/src/routes/schemas.js b/src/routes/schemas.js index ef2e15e86..7c9ed66ba 100644 --- a/src/routes/schemas.js +++ b/src/routes/schemas.js @@ -73,6 +73,7 @@ export const OrgGetStarted = v.strictObject({ export const OrgDatasetOverview = v.strictObject({ organisation: OrgField, dataset: DatasetNameField, + issueCount: v.integer(), stats: v.strictObject({ numberOfRecords: v.integer(), numberOfFieldsSupplied: v.integer(),