approveJoinRequests( )
Approves requests to join a group.
Description
Note: This function is only relevant for private groups.
The approveJoinRequests()
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
.
Note: If the
suppressAuth
option is set totrue
, all permissions are overwritten, and all site members (including non-group members) can approve site member requests to join a group.
Syntax
function approveJoinRequests(identifiers: Identifiers, [options: Options]): Promise<Array<JoinRequest>>
approveJoinRequests Parameters
NAME
TYPE
DESCRIPTION
Group ID and member IDs.
Authorization options.
Returns
Return Type:
NAME
TYPE
DESCRIPTION
Site member ID of the requester.
Date the site member requested to join the group.
Status of the request to join a group. One of:
"PENDING"
"APPROVED"
"REJECTED"
Reason the request to join a group was rejected.
Was this helpful?
Approve a request to join a group
1import { Permissions, webMethod } from 'wix-web-module';2import { joinRequests } from 'wix-groups-backend';34// Sample identifiers value:5// {6// groupId: '77490611-53bb-4b47-a7cc-ca9a1335133b',7// memberIds: ['124cd3db-e9be-4980-93c1-a6d767a11099', '2f48e9e1-d050-4c86-9684-e7f231600f29', '772cd3db-e9be-560-93c1-a6d767a11670']8// }9//10// Sample options value:11// {12// suppressAuth: true13// }1415export const myApproveJoinRequestsFunction = webMethod(Permissions.Anyone, (identifiers, options) => {16 return joinRequests.approveJoinRequests(identifiers, options)17 .then((approvedJoinRequests) => {18 return approvedJoinRequests;19 })20 .catch((error) => {21 console.error(error);22 });23});2425/* Promise resolves to:26 * [27 * {28 * "memberId": "124cd3db-e9be-4980-93c1-a6d767a11099"29 * "_createdDate": "Fri Oct 24 2021 22:45:50 GMT+0300"30 * "status": "APPROVED"31 * },32 * {33 * "memberId": "2f48e9e1-d050-4c86-9684-e7f231600f29"34 * "_createdDate": "Wed May 14 2021 10:05:20 GMT+0300"35 * "status": "APPROVED"36 * },37 * {38 * "memberId": "772cd3db-e9be-560-93c1-a6d767a11670"39 * "_createdDate": "Sun July 11 2020 03:25:30 GMT+0300"40 * "status": "APPROVED"41 * }42 * ]43 */