Open giovabattelli opened 1 day ago
Please note, Sherpa may occasionally provide incomplete or inaccurate information. Always verify critical details and double-check suggested changes before implementation.
The issue at hand is to create a new endpoint for soft deleting a graph collection in the statistics router. The endpoint should be structured as statistics/:graphCollectionId/delete
, and it must accept the graph collection ID as a parameter.
statisticsRouter.js
router.delete('/statistics/:graphCollectionId/delete', graphCollectionController.deleteGraphCollection);
graphCollectionController.js
deleteGraphCollection
function. This function should:
graphCollectionId
from the request parameters.deleted
flag in the database.const deleteGraphCollection = async (req, res) => {
const { graphCollectionId } = req.params;
// Logic to soft delete the graph collection
// Respond with success or failure message
};
tests/statistics.test.js
graphCollectionId
.To implement the soft delete functionality for the graph collection, you will need to modify the routing file to include the new endpoint, implement the deletion logic within the controller, and ensure that adequate tests are written to validate the new functionality. This approach helps maintain the integrity of the existing codebase while adding the required feature.
Description
We need to create an endpoint to soft delete a graph collection. This endpoint should be in the statistics router under the route ‘statistics/:graphCollectionId/delete’ and should take in the graph collection id.
Be sure to include unit tests and screenshots of postman manual tests to ensure everything is working correctly.
Acceptance Criteria
a new endpoint is created in the statistics router under the route ‘statistics/:graphCollectionId/delete’ that soft deletes a graph collection. unit tests and postman screenshot
Proposed Solution
Take a look at some of the other get endpoints we have on Finishline and use it as a reference for this endpoint.
Mocks
No response