Skip to main content

CommunityService

Community service can be used in the following way:
  1. Import the service from our library:
import {CommunityService} from "@selfcommunity/api-services";
  1. Create a function and put the service inside it! The async function getCommunities will 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).

  1. Declare it (or declare multiple params):
const headers = { Authorization: `Bearer ${yourToken}` };
  1. 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()

static getCommunities(params?, config?): Promise<SCPaginatedResponse<SCCommunityType>>

Parameters

ParameterType
params?BaseGetParams
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCCommunityType>>


getPaymentProduct()

static getPaymentProduct(id, config?): Promise<SCCommunityType>

Parameters

ParameterType
idstring | number
config?AxiosRequestConfig

Returns

Promise<SCCommunityType>