Skip to content

Commit

Permalink
feat: added the documentation for thesis request
Browse files Browse the repository at this point in the history
  • Loading branch information
MagliariElio committed Jan 15, 2024
1 parent c91bfd0 commit 7de5852
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
26 changes: 26 additions & 0 deletions backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,31 @@ The proposal is archived.
- `401`: Not authenticated or not authorized (only students are authorized)
- `500`: Internal Server Error

#### For a student retrieves his thesis request

***GET*** `api/proposals/requests`
- Retrieving all data about thesis reques related to a student

- Authentication: required
- Authorization: must be a student
- Request query parameters: _none_
- Request body: _none_

- `Success 200` Response body:
- `request_id`: id of the thesis request
- `title`: title of the thesis request
- `description`: description of the thesis request
- `supervisor_id`: id of the teacher (supervisor for the thesis request)
- `student_id`: id of the student
- `co_supervisor_id`: id of the co supervisor for the thesis request
- `approval_date`: date of the approval
- `status`: status updated

- `Error`
- `401`: Unauthorized - if the user is not logged in
- `404`: Not Found - Thesis request not found for this logged student
- `500`: Internal Server Error - if something went wrong

### For a student insert a thesis request

***POST*** `api/proposals/requests`
Expand All @@ -464,6 +489,7 @@ The proposal is archived.

- `Error`
- `401` Unauthorized - if the user is not logged in
- `403` Unauthorized - there is already a thesis request for the authenticated student
- `404` Invalid teacher - teacher not found in the db
- `422` Invalid body - invalid fields in request body
- `500` Internal Server Error - if something went wrong
Expand Down
2 changes: 1 addition & 1 deletion backend/controllers/proposals.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ module.exports = {
* @params none
* @body none
* @returns { proposal: { request_id: number, title: string, ... } }
* @status 201 Success status
* @status 200 Success status
* @error 401 Unauthorized - if the user is not logged in
* @error 500 Internal Server Error - if something went wrong
*
Expand Down
3 changes: 2 additions & 1 deletion backend/routes/proposals.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ const isArrayOfStrings = (array) => {
* @params none
* @body none
* @returns { proposal: { request_id: number, title: string, ... } }
* @status 201 Success status
* @status 200 Success status
* @error 401 Unauthorized - if the user is not logged in
* @error 404 Not found - thesis request not found for this logged student
* @error 500 Internal Server Error - if something went wrong
*
* @note Refer to the official documentation for more details
Expand Down

0 comments on commit 7de5852

Please sign in to comment.