CommunityService
Community service can be used in the following way:
- Import the service from our library:
import {CommunityService} from "@selfcommunity/api-services";
- Create a function and put the service inside it! The async function
getCommunitieswill return the events matching the search query.
async function getCommunities() {
return await CommunityService.getCommunities({...});
}
If you need to customize the request, you can add optional config params (AxiosRequestConfig type).
- Declare it (or declare multiple params):
const headers = { Authorization: `Bearer ${yourToken}` };
- Add it inside the brackets and pass it to the function, as shown in the previous example!
Constructors
Constructor
new CommunityService():
CommunityService
Returns
CommunityService
Methods
getCommunities()
staticgetCommunities(params?,config?):Promise<SCPaginatedResponse<SCCommunityType>>
Parameters
| Parameter | Type |
|---|---|
params? | BaseGetParams |
config? | AxiosRequestConfig |
Returns
Promise<SCPaginatedResponse<SCCommunityType>>
getPaymentProduct()
staticgetPaymentProduct(id,config?):Promise<SCCommunityType>
Parameters
| Parameter | Type |
|---|---|
id | string | number |
config? | AxiosRequestConfig |
Returns
Promise<SCCommunityType>