rejectCreateRequests( )
Rejects requests to create a group.
Description
Note: This function is only relevant if admin approval is required for creating a group, or if the function's
suppressAuth
option is set totrue
.
The rejectCreateRequests()
function returns a Promise that resolves when the site member's request to create a group is rejected.
Only site admins can reject requests to create a group.
Note: If the
suppressAuth
option is set totrue
, all permissions are overwritten, and all site members can reject requests to create a group.
Syntax
function rejectCreateRequests(rejections: Array<RejectCreateRequest>, [options: Options]): Promise<Array<CreateRequest>>
rejectCreateRequests Parameters
NAME
TYPE
DESCRIPTION
Rejection data.
Authorization options.
Returns
Return Type:
NAME
TYPE
DESCRIPTION
ID of the request to create a group. Same as group ID.
Status of the request to create a group. One of:
"PENDING"
"APPROVED"
"REJECTED"
Reason the request to create a group was rejected.
Group requested to create.
Was this helpful?
Reject a request to create a group
1import { Permissions, webMethod } from 'wix-web-module';2import { createRequests } from 'wix-groups-backend';34// Sample rejections value:5// [6// {7// createRequestId: '77490611-53bb-4b47-a7cc-ca9a1335133b',8// reason: 'This group is for teachers only'9// }10// ]11//12// Sample options value:13// {14// suppressAuth: true15// }16//1718export const myRejectCreateRequestsFunction = webMethod(Permissions.Anyone, (rejections, options) => {19 return createRequests.rejectCreateRequests(rejections, options)20 .then((rejectedCreateRequests) => {21 return rejectedCreateRequests;22 })23 .catch((error) => {24 console.error(error);25 });26});2728/* Promise resolves to:29 * [30 * {31 * "_id": "77490611-53bb-4b47-a7cc-ca9a1335133b",32 * "status": "REJECTED"33 * "rejectionReason": "This group is for teachers only."34 * "group": {35 * "_id": "77490611-53bb-4b47-a7cc-ca9a1335133b"36 * "name": "My Group Request 5"37 * "slug": "my-group-request-5"38 * "description": "Welcome to the group! You can connect with other members, get updates and share videos."39 * "privacyStatus": "PRIVATE"40 * "coverImage": {41 * "imageUrl": "wix:image://v1/jb9074e348009011fa9f2dzj0jn~mv2.jpg/nutmeg.jpg#originWidth=800&originHeight=720",42 * "position": {43 * "x": 66,44 * "y": 1045 * }46 * }47 * "memberTitle": "Co-workers"48 * "memberCount": 149 * "settings": {50 * "groupUpdatePostEnabled": true51 * "membersCanApprove": false52 * "membersCanInvite": true53 * "showMemberList": true54 * "welcomeMemberPostEnabled": true55 * }56 * "lastActivityDate": "Sun Sep 26 2021 08:23:23 GMT+0300"57 * "_createdDate": "Sun Sep 26 2021 08:23:23 GMT+0300"58 * "_updatedDate": "Sun Sep 26 2021 08:23:23 GMT+0300"59 * "owner": "9ne8e9e1-d050-4c86-9684-e7f231600a34"60 * }61 * }62 * ]63 */