Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions src/middleware/lpa-overview.middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,18 +190,9 @@ export const addNoticesToDatasets = (req, res, next) => {
next()
}
/**
* Updates req.datasets objects with endpoint status and error information.
* Populates `req.datasets` with status, error, and issue information for each available dataset.
*
* @param {Object} req
* @param {Object} req.issues
* @param {Object} req.endpoints
* @param {Object[]} [req.expectationOutOfBounds]
* @param {string} req.expectationOutOfBounds[].dataset
* @param {boolean} req.expectationOutOfBounds[].passed - did the exepectation pass
* @param {string[]} req.availableDatasets
* @param {Object[]} [req.datasets] OUT param
* @param {*} res
* @param {*} next
* For each dataset, determines the number of endpoints, aggregates issue counts (including expectation violations), and sets the dataset's status as 'Not submitted', 'Error', 'Needs fixing', or 'Live'. If all endpoints for a dataset are in error, includes an error message with the HTTP status.
*/
export function prepareDatasetObjects (req, res, next) {
const { issues, endpoints, expectationOutOfBounds, availableDatasets } = req
Expand Down