rejectJoinRequests( )
Rejects requests to join a group.
Description
Note: This function is only relevant for private groups.
The rejectJoinRequests()
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
.
Note: If the
suppressAuth
option is set totrue
, all permissions are overwritten, and all site members (including non-group members) can reject site member requests to join a group.
Syntax
function rejectJoinRequests(groupId: string, rejections: Array<Rejection>, [options: Options]): Promise<Array<JoinRequest>>
rejectJoinRequests Parameters
NAME
TYPE
DESCRIPTION
ID of the group requested to join.
Rejection data.
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?
Reject a request to join a group
1import { Permissions, webMethod } from 'wix-web-module';2import { joinRequests } from 'wix-groups-backend';34// Sample groupId value:5// "6z2334b13bb4b44569a7cdf292j227"6//7// Sample rejections value:8// [9// {10// memberId: '77490611-53bb-4b47-a7cc-ca9a1335133b',11// reason: 'This group is for college students only.'12// }13// ]1415export const myRejectJoinRequestsFunction = webMethod(Permissions.Anyone, (groupId, rejections) => {16 return joinRequests.rejectJoinRequests(groupId, rejections)17 .then((rejectedJoinRequests) => {18 console.log('Rejected ', rejectedJoinRequests);19 })20 .catch((error) => {21 console.error(error);22 });23});2425/* Promise resolves to:26 * [27 * {28 * "memberId": "77490611-53bb-4b47-a7cc-ca9a1335133b"29 * "_createdDate": "Mon July 12 2020 13:15:10 GMT+0300"30 * "status": "REJECTED"31 * "rejectionReason": "This group is for college students only."32 * }33 * ]34 */