From 95b3a6d6d4c8ab946ab285cbded6909f6f86c85f Mon Sep 17 00:00:00 2001 From: "coderabbitai[bot]" <136622811+coderabbitai[bot]@users.noreply.github.com> Date: Fri, 27 Jun 2025 09:00:04 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Add=20docstrings=20to=20`bugfix/?= =?UTF-8?q?provider-service-endpoint-status`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Docstrings generation was requested by @Ben-Hodgkiss. * https://github.com/digital-land/submit/pull/1063#issuecomment-3008765839 The following files were modified: * `src/middleware/lpa-overview.middleware.js` --- src/middleware/lpa-overview.middleware.js | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/middleware/lpa-overview.middleware.js b/src/middleware/lpa-overview.middleware.js index fda89dca7..d9fccffc3 100644 --- a/src/middleware/lpa-overview.middleware.js +++ b/src/middleware/lpa-overview.middleware.js @@ -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