This controller is in charge of handling requests relating to streams
Methods
# static acceptRequestToJoin()
Rejects a request to join stream from a user
Parameters:
Name | Type | Description |
---|---|---|
req.body.data |
* | data of the request we want to reject |
# static closeStream()
Closes the user's stream if one exists (and if user exists)
# static createStream()
Tries to create a new stream using the streamData and redirects to newly created page upon success
Note: This will fail if now user is signed in/ or the user already has a current stream
It adds a new stream to the current user, adds the stream to the database, and notifies all the user's followers
That he created a new stream.
Parameters:
Name | Type | Description |
---|---|---|
req.body |
* | the stream Data |
# static getStreamsByStatus()
Finds all streams with a given status
Parameters:
Name | Type | Description |
---|---|---|
req.body.page |
* | what page to request |
req.body.status |
* | stream status |
# static rejectRequestToJoin()
Rejects a request to join stream from a user
Parameters:
Name | Type | Description |
---|---|---|
req.body.data |
* | data of the request we want to reject |
# static requestToJoinStream()
Sends a request from currently logged in user to join a stream
Note: Requests are cached and are limited to one request per user every 2 minutes
Parameters:
Name | Type | Description |
---|---|---|
req.body.data |
* | formatted data of the current user (which is verified in the backend) |
req.body.creatorId |
* | Id of the creator to send request to |
string describing error if failed, otherwise a request is sent
# static searchStreams()
Searches all streams split to pages by a search string
Searches tags/description/name
Parameters:
Name | Type | Description |
---|---|---|
req.body.searchString |
* | string to search |
req.body.page |
* | what page to request |
req.body.status |
* | stream status |
# inner addStreamer(streamId, streamerData)
Parameters:
Name | Type | Description |
---|---|---|
streamId |
* | id of the streamer |
streamerData |
* | data of the streamer |