Skip to main content

GroupService

Incubator service can be used in the following way:
1. Import the service from our library:

import {GroupService} from "@selfcommunity/api-services";
2. Create a function and put the service inside it!
The async function `searchGroups` will return the groups matching the search query.

async searchGroups() {
return await GroupService.searchGroups();
}
In case of required `params`, just add them inside the brackets.

async getSpecificGroupInfo(groupId) {
return await GroupService.getSpecificGroupInfo(groupId);
}
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 GroupService()

new GroupService(): GroupService

Returns

GroupService

Methods

changeGroupAvatarOrCover()

static changeGroupAvatarOrCover(id, data, config?): Promise<SCGroupType>

Parameters

ParameterType
idstring | number
dataFormData
config?AxiosRequestConfig<any>

Returns

Promise<SCGroupType>

Source

services/group/index.ts:322


createGroup()

static createGroup(data, config?): Promise<SCGroupType>

Parameters

ParameterType
dataGroupCreateParams | FormData
config?AxiosRequestConfig<any>

Returns

Promise<SCGroupType>

Source

services/group/index.ts:313


getGroupFeed()

static getGroupFeed(id, params?, config?): Promise<any>

Parameters

ParameterType
idstring | number
params?GroupFeedParams
config?AxiosRequestConfig<any>

Returns

Promise<any>

Source

services/group/index.ts:310


getGroupInvitedUsers()

static getGroupInvitedUsers(id, params?, config?): Promise <SCPaginatedResponse<SCUserType>>

Parameters

ParameterType
idstring | number
params?BaseGetParams
config?AxiosRequestConfig<any>

Returns

Promise <SCPaginatedResponse<SCUserType>>

Source

services/group/index.ts:337


getGroupMembers()

static getGroupMembers(id, params?, config?): Promise <SCPaginatedResponse<SCUserType>>

Parameters

ParameterType
idstring | number
params?BaseGetParams
config?AxiosRequestConfig<any>

Returns

Promise <SCPaginatedResponse<SCUserType>>

Source

services/group/index.ts:325


getGroupSubscriptionStatus()

static getGroupSubscriptionStatus(id, config?): Promise <SCPaginatedResponse<any>>

Parameters

ParameterType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise <SCPaginatedResponse<any>>

Source

services/group/index.ts:353


getGroupSuggestedUsers()

static getGroupSuggestedUsers(id, search, config?): Promise <SCPaginatedResponse<SCUserType>>

Parameters

ParameterType
idstring | number
searchstring
config?AxiosRequestConfig<any>

Returns

Promise <SCPaginatedResponse<SCUserType>>

Source

services/group/index.ts:328


getGroupWaitingApprovalSubscribers()

static getGroupWaitingApprovalSubscribers(id, params?, config?): Promise <SCPaginatedResponse<SCUserType>>

Parameters

ParameterType
idstring | number
params?BaseGetParams
config?AxiosRequestConfig<any>

Returns

Promise <SCPaginatedResponse<SCUserType>>

Source

services/group/index.ts:356


getGroupsSuggestedUsers()

static getGroupsSuggestedUsers(search, config?): Promise <SCPaginatedResponse<SCUserType>>

Parameters

ParameterType
searchstring
config?AxiosRequestConfig<any>

Returns

Promise <SCPaginatedResponse<SCUserType>>

Source

services/group/index.ts:331


getSpecificGroupInfo()

static getSpecificGroupInfo(id, config?): Promise<SCGroupType>

Parameters

ParameterType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<SCGroupType>

Source

services/group/index.ts:307


getUserGroups()

static getUserGroups(params?, config?): Promise <SCPaginatedResponse<SCGroupType>>

Parameters

ParameterType
params?BaseSearchParams
config?AxiosRequestConfig<any>

Returns

Promise <SCPaginatedResponse<SCGroupType>>

Source

services/group/index.ts:294


getUserSubscribedGroups()

static getUserSubscribedGroups(id, params?, config?): Promise <SCPaginatedResponse<SCGroupType>>

Parameters

ParameterType
idstring | number
params?BaseSearchParams
config?AxiosRequestConfig<any>

Returns

Promise <SCPaginatedResponse<SCGroupType>>

Source

services/group/index.ts:297


inviteOrAcceptGroupRequest()

static inviteOrAcceptGroupRequest(id, data, config?): Promise<any>

Parameters

ParameterType
idstring | number
dataobject
data.usersnumber[]
config?AxiosRequestConfig<any>

Returns

Promise<any>

Source

services/group/index.ts:350


patchGroup()

static patchGroup(id, data, config?): Promise<SCGroupType>

Parameters

ParameterType
idstring | number
dataSCGroupType
config?AxiosRequestConfig<any>

Returns

Promise<SCGroupType>

Source

services/group/index.ts:319


removeUserFromGroup()

static removeUserFromGroup(id, user, config?): Promise<any>

Parameters

ParameterType
idstring | number
userstring | number
config?AxiosRequestConfig<any>

Returns

Promise<any>

Source

services/group/index.ts:334


searchGroups()

static searchGroups(params?, config?): Promise <SCPaginatedResponse<SCGroupType>>

Parameters

ParameterType
params?BaseSearchParams
config?AxiosRequestConfig<any>

Returns

Promise <SCPaginatedResponse<SCGroupType>>

Source

services/group/index.ts:304


subscribeToGroup()

static subscribeToGroup(id, config?): Promise<any>

Parameters

ParameterType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<any>

Source

services/group/index.ts:344


unsubscribeFromGroup()

static unsubscribeFromGroup(id, config?): Promise<any>

Parameters

ParameterType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<any>

Source

services/group/index.ts:347


updateGroup()

static updateGroup(id, data, config?): Promise<SCGroupType>

Parameters

ParameterType
idstring | number
dataSCGroupType
config?AxiosRequestConfig<any>

Returns

Promise<SCGroupType>

Source

services/group/index.ts:316