EventService
1. Import the service from our library:
import {EventService} from "@selfcommunity/api-services";
2. Create a function and put the service inside it!
The async function `searchEvents` will return the events matching the search query.
async searchEvents() {
return await EventService.searchEvents();
}
In case of required `params`, just add them inside the brackets.
async getSpecificEventInfo(eventId) {
return await EventService.getSpecificEventInfo(eventId);
}
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
new EventService()
new EventService():
EventService
Returns
Methods
changeEventCover()
static
changeEventCover(id
,data
,config
?):Promise
<SCEventType
>
Parameters
Parameter | Type |
---|---|
id | string | number |
data | FormData |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCEventType
>
Source
createEvent()
static
createEvent(data
,config
?):Promise
<SCEventType
>
Parameters
Parameter | Type |
---|---|
data | EventCreateParams | FormData |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCEventType
>
Source
deleteEvent()
static
deleteEvent(id
,config
?):Promise
<any
>
Parameters
Parameter | Type |
---|---|
id | string | number |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<any
>
Source
getEventFeed()
static
getEventFeed(id
,params
?,config
?):Promise
<any
>
Parameters
Parameter | Type |
---|---|
id | string | number |
params ? | EventFeedParams |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<any
>
Source
getEventInvitedUsers()
static
getEventInvitedUsers(id
,params
?,config
?):Promise
<SCPaginatedResponse
<SCUserType
>>
Parameters
Parameter | Type |
---|---|
id | string | number |
params ? | BaseGetParams |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCUserType
>>
Source
getEventMembers()
static
getEventMembers(id
,params
?,config
?):Promise
<SCPaginatedResponse
<SCUserType
>>
Parameters
Parameter | Type |
---|---|
id | string | number |
params ? | BaseGetParams |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCUserType
>>
Source
getEventRelated()
static
getEventRelated(id
,params
?,config
?):Promise
<SCPaginatedResponse
<SCEventType
>>
Parameters
Parameter | Type |
---|---|
id | string | number |
params ? | EventRelatedParams |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCEventType
>>
Source
getEventSubscriptionStatus()
static
getEventSubscriptionStatus(id
,config
?):Promise
<SCPaginatedResponse
<any
>>
Parameters
Parameter | Type |
---|---|
id | string | number |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<any
>>
Source
getEventSuggestedUsers()
static
getEventSuggestedUsers(id
,search
,config
?):Promise
<SCPaginatedResponse
<SCUserType
>>
Parameters
Parameter | Type |
---|---|
id | string | number |
search | string |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCUserType
>>
Source
getEventWaitingApprovalSubscribers()
static
getEventWaitingApprovalSubscribers(id
,params
?,config
?):Promise
<SCPaginatedResponse
<SCUserType
>>
Parameters
Parameter | Type |
---|---|
id | string | number |
params ? | BaseGetParams |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCUserType
>>
Source
getEventsSuggestedUsers()
static
getEventsSuggestedUsers(search
,config
?):Promise
<SCPaginatedResponse
<SCUserType
>>
Parameters
Parameter | Type |
---|---|
search | string |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCUserType
>>
Source
getSpecificEventInfo()
static
getSpecificEventInfo(id
,config
?):Promise
<SCEventType
>
Parameters
Parameter | Type |
---|---|
id | string | number |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCEventType
>
Source
getUserCretaedEvents()
static
getUserCretaedEvents(params
?,config
?):Promise
<SCPaginatedResponse
<SCEventType
>>
Parameters
Parameter | Type |
---|---|
params ? | EventRelatedParams |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCEventType
>>
Source
getUserEvents()
static
getUserEvents(params
?,config
?):Promise
<SCPaginatedResponse
<SCEventType
>>
Parameters
Parameter | Type |
---|---|
params ? | EventUserParams |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCEventType
>>
Source
getUserSubscribedEvents()
static
getUserSubscribedEvents(id
,params
?,config
?):Promise
<SCPaginatedResponse
<SCEventType
>>
Parameters
Parameter | Type |
---|---|
id | string | number |
params ? | BaseSearchParams |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCEventType
>>
Source
getUsersGoingToEvent()
static
getUsersGoingToEvent(id
,params
?,config
?):Promise
<SCPaginatedResponse
<SCUserType
>>
Parameters
Parameter | Type |
---|---|
id | string | number |
params ? | BaseGetParams |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCUserType
>>
Source
getUsersNotGoingToEvent()
static
getUsersNotGoingToEvent(id
,params
?,config
?):Promise
<SCPaginatedResponse
<SCUserType
>>
Parameters
Parameter | Type |
---|---|
id | string | number |
params ? | BaseGetParams |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCUserType
>>
Source
goToEvent()
static
goToEvent(id
,config
?):Promise
<SCPaginatedResponse
<any
>>
Parameters
Parameter | Type |
---|---|
id | string | number |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<any
>>
Source
hideEvent()
static
hideEvent(id
,config
?):Promise
<any
>
Parameters
Parameter | Type |
---|---|
id | string | number |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<any
>
Source
inviteOrAcceptEventRequest()
static
inviteOrAcceptEventRequest(id
,data
,config
?):Promise
<any
>
Parameters
Parameter | Type |
---|---|
id | string | number |
data | object |
data.users | number [] |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<any
>
Source
notGoingToEvent()
static
notGoingToEvent(id
,config
?):Promise
<SCPaginatedResponse
<any
>>
Parameters
Parameter | Type |
---|---|
id | string | number |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<any
>>
Source
patchEvent()
static
patchEvent(id
,data
,config
?):Promise
<SCEventType
>
Parameters
Parameter | Type |
---|---|
id | string | number |
data | SCEventType |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCEventType
>
Source
removeGoingToEvent()
static
removeGoingToEvent(id
,config
?):Promise
<SCPaginatedResponse
<any
>>
Parameters
Parameter | Type |
---|---|
id | string | number |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<any
>>
Source
removeInviteEvent()
static
removeInviteEvent(id
,data
,config
?):Promise
<any
>
Parameters
Parameter | Type |
---|---|
id | string | number |
data | object |
data.users | number [] |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<any
>
Source
removeNotGoingToEvent()
static
removeNotGoingToEvent(id
,config
?):Promise
<SCPaginatedResponse
<any
>>
Parameters
Parameter | Type |
---|---|
id | string | number |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<any
>>
Source
searchEvents()
static
searchEvents(params
?,config
?):Promise
<SCPaginatedResponse
<SCEventType
>>
Parameters
Parameter | Type |
---|---|
params ? | EventSearchParams |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCEventType
>>
Source
showEvent()
static
showEvent(id
,config
?):Promise
<any
>
Parameters
Parameter | Type |
---|---|
id | string | number |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<any
>
Source
subscribeToEvent()
static
subscribeToEvent(id
,config
?):Promise
<any
>
Parameters
Parameter | Type |
---|---|
id | string | number |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<any
>
Source
unsubscribeFromEvent()
static
unsubscribeFromEvent(id
,config
?):Promise
<any
>
Parameters
Parameter | Type |
---|---|
id | string | number |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<any
>
Source
updateEvent()
static
updateEvent(id
,data
,config
?):Promise
<SCEventType
>
Parameters
Parameter | Type |
---|---|
id | string | number |
data | SCEventType |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCEventType
>