LiveStreamService
1. Import the service from our library:
import {LiveStreamService} from "@selfcommunity/api-services";
2. Create a function and put the service inside it!
The async function `search` will return the LiveStreams matching the search query.
async searchLiveStreams() {
return await LiveStreamService.search();
}
In case of required `params`, just add them inside the brackets.
async getSpecificInfo(liveStreamId) {
return await LiveStreamService.getSpecificInfo(liveStreamId);
}
If you need to customize the request, you can add optional config params (`AxiosRequestConfig` type).
1. Declare it(or declare them, it is possible to add multiple params)
const headers = headers: {Authorization: `Bearer ${yourToken}`}
2. Add it inside the brackets and pass it to the function, as shown in the previous example!
Constructors
Constructor
new LiveStreamService():
LiveStreamService
Returns
LiveStreamService
Methods
changeCover()
static
changeCover(id
,data
,config?
):Promise
<SCLiveStreamType
>
Parameters
Parameter | Type |
---|---|
id | string | number |
data | FormData |
config? | AxiosRequestConfig |
Returns
Promise
<SCLiveStreamType
>
close()
static
close(id
,config?
):Promise
<SCLiveStreamType
>
Parameters
Parameter | Type |
---|---|
id | string | number |
config? | AxiosRequestConfig |
Returns
Promise
<SCLiveStreamType
>
create()
static
create(data
,config?
):Promise
<SCLiveStreamType
>
Parameters
Parameter | Type |
---|---|
data | LiveStreamCreateParams | FormData |
config? | AxiosRequestConfig |
Returns
Promise
<SCLiveStreamType
>
delete()
static
delete(id
,config?
):Promise
<any
>
Parameters
Parameter | Type |
---|---|
id | string | number |
config? | AxiosRequestConfig |
Returns
Promise
<any
>
getMonthlyDuration()
static
getMonthlyDuration(config?
):Promise
<SCLiveStreamMonthlyDurationType
>
Parameters
Parameter | Type |
---|---|
config? | AxiosRequestConfig |
Returns
Promise
<SCLiveStreamMonthlyDurationType
>
getSpecificInfo()
static
getSpecificInfo(id
,config?
):Promise
<SCLiveStreamType
>
Parameters
Parameter | Type |
---|---|
id | string | number |
config? | AxiosRequestConfig |
Returns
Promise
<SCLiveStreamType
>
join()
static
join(id
,config?
):Promise
<SCLiveStreamConnectionDetailsType
>
Parameters
Parameter | Type |
---|---|
id | string | number |
config? | AxiosRequestConfig |
Returns
Promise
<SCLiveStreamConnectionDetailsType
>
patch()
static
patch(id
,data
,config?
):Promise
<SCLiveStreamType
>
Parameters
Parameter | Type |
---|---|
id | string | number |
data | SCLiveStreamType |
config? | AxiosRequestConfig |
Returns
Promise
<SCLiveStreamType
>
removeParticipant()
static
removeParticipant(id
,data
,config?
):Promise
<any
>
Parameters
Parameter | Type |
---|---|
id | string | number |
data | LiveStreamRemoveParticipantParams | FormData |
config? | AxiosRequestConfig |
Returns
Promise
<any
>
search()
static
search(params?
,config?
):Promise
<SCPaginatedResponse
<SCLiveStreamType
>>
Parameters
Parameter | Type |
---|---|
params? | LiveStreamSearchParams |
config? | AxiosRequestConfig |
Returns
Promise
<SCPaginatedResponse
<SCLiveStreamType
>>
update()
static
update(id
,data
,config?
):Promise
<SCLiveStreamType
>
Parameters
Parameter | Type |
---|---|
id | string | number |
data | SCLiveStreamType |
config? | AxiosRequestConfig |
Returns
Promise
<SCLiveStreamType
>