Setup
To use the JoinGroupRequests API, install the @wix/groups
package using npm or Yarn:
1npm install @wix/groups
or
1yarn add @wix/groups
Then import { joinGroupRequests }
from @wix/groups
:
1import { joinGroupRequests } from '@wix/groups'
Approves requests to join a group.
Note: This function is only relevant for private groups.
The approvejoinGroupRequests()
function returns a Promise that resolves when a site member's request to join a group is approved.
Only site admins and group admins can approve site member requests to join a group, unless the group setting, membersCanApprove
is set to true
.
function approveJoinGroupRequests(groupId: string, memberIds: Array<string>, options: ApproveJoinGroupRequestsOptions): Promise<ApproveJoinGroupRequestsResponse>
ID of the group requested to join.
IDs of the site members to approve.
Lists requests to join a group.
Note: This function is only relevant for private groups.
The listjoinGroupRequests()
function returns a Promise that resolves to a list of up to 100 requests to join a group. Sorts by default to _createdDate
in descending order.
Only site admins and group admins can see requests to join their group. Site members can access their own join requests in their site.
Notes:
function listJoinGroupRequests(groupId: string, options: ListJoinGroupRequestsOptions): Promise<ListJoinGroupRequestsResponse>
ID of the group requested to join.
Creates a query to retrieve a list of join requests.
Notes:
- This function is only relevant for private groups.
- For
SECRET
groups, only site admins and group admins can query requests to join their group.
The queryjoinGroupRequests()
function builds a query to retrieve a list of all requests to join a group, and returns a joinGroupRequestsQueryBuilder object.
The returned object contains the query definition which is typically used to run the query using the find()
function.
You can refine the query by chaining joinGroupRequestsQueryBuilder
functions onto the query. joinGroupRequestsQueryBuilder
functions enable you to sort, filter, and control the results that queryjoinGroupRequests()
returns.
The results of the queryjoinGroupRequests()
function are sorted by _createdDate
in descending order.
queryjoinGroupRequests()
runs with this joinGroupRequestsQueryBuilder
default, which you can override:
The following joinGroupRequestsQueryBuilder
functions are supported for queryjoinGroupRequests()
. For a full description of the joinGroupRequests object, see the object returned for the items
property in joinGroupRequestsQueryResult
.
Property | Supported Filters & Sorting |
---|---|
status | eq() , ne() , hasSome() , or() |
PROPERTY | SUPPORTED FILTERS & SORTING |
---|---|
status | eq() ,ne() ,exists() ,in() ,hasSome() |
function queryJoinGroupRequests(groupId: string, options: QueryJoinGroupRequestsOptions): JoinGroupRequestsQueryBuilder
Group ID.
Rejects requests to join a group.
Note: This function is only relevant for private groups.
The rejectjoinGroupRequests()
function returns a Promise that resolves when the site member's request to join a group is rejected.
Only site admins or group admins can reject site member requests to join the group, unless the group setting, membersCanApprove
is set to true
.
function rejectJoinGroupRequests(groupId: string, rejections: Array<Rejection>): Promise<RejectJoinGroupRequestsResponse>
ID of the group requested to join.
Rejection data.