From 232db360172d0010a025e9393f07ba2d07e05fa1 Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Fri, 22 Dec 2023 15:43:46 +0000 Subject: [PATCH] feat: Updated backend/src/controllers/regionContro --- backend/src/controllers/regionController.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/backend/src/controllers/regionController.js b/backend/src/controllers/regionController.js index 5d3b144..8dbe82a 100644 --- a/backend/src/controllers/regionController.js +++ b/backend/src/controllers/regionController.js @@ -217,6 +217,13 @@ async function getSubregions(regionId, hierarchyId, getAll) { } // Retrieve the divisions of a region. It does not include subdivisions of the divisions. +/** + * Retrieves the divisions of a region. + * + * @param {number} regionId - The ID of the region. + * @param {number} hierarchyId - The ID of the hierarchy. + * @returns {Promise} - A promise that resolves to an array of divisions. + */ async function getDivisions(regionId, hierarchyId) { const regions = (await getSubregions(regionId, hierarchyId, false)).data; // Add the region itself