We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
We need to implement a set of API routes to manage regions in our application. Each region will have the following details:
name
description
createdBy
polygon
/api/region/
/api/region/:id
id
Define Region Model: Update or create the Region model to include name, description, createdBy, and polygon.
Implement Middleware: Create a middleware function to check if the logged-in user is a superadmin.
Implement Routes:
getAll
getById
create
updateById
deleteById
Add Routes to API Testing Tool: Add the new routes to the Bruno API testing tool for easy testing and verification.
Testing: Write tests for each route to ensure they are working correctly and are properly secured with the middleware.
The text was updated successfully, but these errors were encountered:
eswarmamidi19
No branches or pull requests
We need to implement a set of API routes to manage regions in our application. Each region will have the following details:
name
: The name of the region.description
: A brief description of the region.createdBy
: The user who created the region.polygon
: A list of location points that represent a polygon on the map.Routes to be Implemented
/api/region/
/api/region/:id
id
as path parameter/api/region/
name
,description
,polygon
/api/region/:id
/api/region/:id
Middleware for Authentication
Tasks
Define Region Model: Update or create the Region model to include
name
,description
,createdBy
, andpolygon
.Implement Middleware: Create a middleware function to check if the logged-in user is a superadmin.
Implement Routes:
getAll
: Fetch and return an array of available regions.getById
: Fetch and return details of a single region by its ID.create
: Add a new region with the given details.updateById
: Update the details of an existing region by its ID.deleteById
: Delete a region by its ID.Add Routes to API Testing Tool: Add the new routes to the Bruno API testing tool for easy testing and verification.
Testing: Write tests for each route to ensure they are working correctly and are properly secured with the middleware.
The text was updated successfully, but these errors were encountered: