ISSUE_NUMBER: GH-4
Description
The /update/chapternumber route in routes/chapterRoutes.js uses the POST method, which is not semantically correct for updating a resource. It should use PUT or PATCH instead.
File: repositories/QuestionBankapi/routes/chapterRoutes.js
Line: 23
Severity: medium
Current Behavior
The route uses POST to update the chapter number.
Expected Behavior
The route should use PUT or PATCH to update the chapter number.
Suggested Fix
Change the HTTP method from POST to PUT or PATCH.
Code Context
router.post("/update/chapternumber", chapterNumberUpdate)
Additional Notes
Using the correct HTTP method improves the API's clarity and adherence to RESTful principles.
ISSUE_NUMBER: GH-4
Description
The
/update/chapternumberroute inroutes/chapterRoutes.jsuses thePOSTmethod, which is not semantically correct for updating a resource. It should usePUTorPATCHinstead.File:
repositories/QuestionBankapi/routes/chapterRoutes.jsLine: 23
Severity: medium
Current Behavior
The route uses
POSTto update the chapter number.Expected Behavior
The route should use
PUTorPATCHto update the chapter number.Suggested Fix
Change the HTTP method from
POSTtoPUTorPATCH.Code Context
Additional Notes
Using the correct HTTP method improves the API's clarity and adherence to RESTful principles.