Members
(constant) axios
This module contains handlers for the "team" route.
Methods
(async) getTeam(req, res)
Gets the team document from the database on /team/:team_id.
Parameters:
Name | Type | Description |
---|---|---|
req |
* | request object, containing team id in the url |
res |
* | response object, the found team document |
Returns:
-
200: the team was found
-
404: team is not found
-
400: team id is not in a valid hexadecimal format
(async) storeHandle(req, res)
Associates a twitter handle with a team on the /team/twitter-handle/:team-id endpoint.
Parameters:
Name | Type | Description |
---|---|---|
req |
* | request object, containing the team_id in the url and twitter handle in the body |
res |
* | response object |
Returns:
-
200: successful added twitter handle to team
-
400: team id is not in a valid hexadecimal format
-
404: team is not found, or handle is invalid
-
500: error trying to update the document in db