Search.../

rejectJoinGroupRequests( )

Rejects requests to join a group.

Description

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.

Admin Method

This function requires elevated permissions to run. This function is not universal and runs only on the backend.

Syntax

function rejectJoinGroupRequests(groupId: string, rejections: Array<Rejection>): Promise<RejectJoinGroupRequestsResponse>

rejectJoinGroupRequests Parameters

NAME
TYPE
DESCRIPTION
groupId
string

ID of the group requested to join.

rejections
Array<
Rejection
>

Rejection data.

Returns

Return Type:

Promise<
RejectJoinGroupRequestsResponse
>
NAME
TYPE
DESCRIPTION
joinGroupRequests
Array<
JoinGroupRequest
>

Rejected join group requests.

Was this helpful?

Reject a request to join a group

Copy Code
1
2import { joinGroupRequests } from 'wix-groups.v2';
3
4// Sample groupId: "6z2334b13bb4b44569a7cdf292j227"
5//
6// Sample rejections value:
7// [
8// {
9// memberId: '77490611-53bb-4b47-a7cc-ca9a1335133b',
10// reason: 'This group is for college students only.'
11// }
12// ]
13
14 async function rejectJoinGroupRequests(groupId, rejections, options) {
15 try {
16 const result = await joinGroupRequests.rejectJoinGroupRequests(groupId, rejections);
17
18 return result;
19 } catch (error) {
20 console.error(error);
21 // Handle the error
22 }
23 }
24
25 /* Promise resolves to:
26 * joinGroupRequests: [
27 * {
28 * "requestDetails": {"rejectionReason": "This group is for college students only."}
29 * "siteMemberId": "124cd3db-e9be-4980-93c1-a6d767a11099"
30 * "status": "REJECTED"
31 * }
32 * ]
33 */