Skip to content

Commit

Permalink
doce(meetings): Add subscribe docs
Browse files Browse the repository at this point in the history
  • Loading branch information
HagerDakroury committed Jul 16, 2021
1 parent ac5a967 commit c16a0e5
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 9 deletions.
34 changes: 26 additions & 8 deletions meetings/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,41 @@
400 - "User is not authorized"
- **join**
- **subscribe**
POST
- for both cases(current, incoming), same endpoint is used, no additional param is needed
http://134.209.132.81:4000/api/v1/meetings/join
http://134.209.132.81:4000/api/v1/meetings/subscribe/{id}
- Response
- A meeting scheduled for later (status=='incoming') and has not been added before
- A meeting has been added before
201 - meeting object
- The meeting doesn't exist (wrong id)
400 - "The meeting doesn't exist"
- Any other error (e.g db connection)
400 - error message
201 - "Meeting added successfully"
- Authorization error
400 - "User is not authorized"
- **join**
POST
http://134.209.132.81:4000/api/v1/meetings/join/{id}
- Response
- A meeting scheduled for later (status=='incoming') and has been added before
- A meeting scheduled for later (status=='incoming') or not part of student's meetings
201 - "Meeting already added before"
400
- A meeting currently in progress (status=='current')
Expand Down
2 changes: 1 addition & 1 deletion meetings/src/routes/join.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ router.post(`${baseUrl}/join/:id`, async (req: Request, res: Response) => {
return res.status(201).send(token);
}

return res.status(400).send("Meeting hasn'r started yet");
return res.status(400).send("Meeting hasn't started yet");
}
} catch (error) {
return res.status(400).send(error.message);
Expand Down

0 comments on commit c16a0e5

Please sign in to comment.