Skip to content

Commit

Permalink
feat: Updated backend/src/routes/regionRoutes.js
Browse files Browse the repository at this point in the history
  • Loading branch information
sweep-ai[bot] authored Jan 14, 2024
1 parent 9f334bf commit 2f457f2
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion backend/src/routes/regionRoutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ router.get(

router.get(
'/search',
/**
* Search regions based on query and hierarchy ID.
*
* @param {Object} req - The request object.
* @param {Object} res - The response object.
* @returns {Object} The response object.
*/
[
query('query').isString().withMessage('Query must be a string'),
query('hierarchyId').optional().isInt(
Expand All @@ -49,6 +56,13 @@ router.get(

router.get(
'/:regionId',
/**
* Get region by ID.
*
* @param {Object} req - The request object.
* @param {Object} res - The response object.
* @returns {Object} The response object.
*/
...[
check('regionId').isInt(
{ min: 0, max: getDataTypeRange(Region, 'id').max },
Expand Down Expand Up @@ -86,7 +100,6 @@ router.get(
return regionController.getSubregions(req, res);
},
);

router.get(
'/:regionId/ancestors',
...[
Expand Down

0 comments on commit 2f457f2

Please sign in to comment.