Search...
rejectGroupRequests( )
Developer Preview
Rejects a request to create a group.
Description
The rejectGroupRequests()
function returns a Promise that resolves when a member's request to create a group is rejected. Only site admins can reject requests to create a group.
Note: This function is only relevant if admin approval is required for creating a group.
Admin Method
This function requires elevated permissions to run. This function is not universal and runs only on the backend.
Authorization
Request
This endpoint does not take any parameters
Response Object
NAME
TYPE
DESCRIPTION
groupRequest
Array<
GroupRequest
>Rejected Group Requests.
Status/Error Codes
Was this helpful?
Reject a request to create a group (dashboard page code)
Copy Code
1import { createRequests } from 'wix-groups.v2';23// Sample rejections value:4// [5// {6// groupRequestId: '77490611-53bb-4b47-a7cc-ca9a1335133b',7// reason: 'This group is for teachers only'8// }9// ]10//1112export function myRejectGroupRequestsFunction(rejections) {13 return createRequests.rejectGroupRequests(rejections)14 .then((rejectedGroupRequests) => {15 return rejectedGroupRequests;16 })17 .catch((error) => {18 console.error(error);19 });20}2122/* Promise resolves to:23 * {24 * "groupRequest": [25 * {26 * "_id": "77490611-53bb-4b47-a7cc-ca9a1335133b",27 * "status": "REJECTED",28 * "rejectionReason": "This group is for teachers only.",29 * "group": {30 * "_id": "77490611-53bb-4b47-a7cc-ca9a1335133b",31 * "name": "My Group Request 5",32 * "slug": "my-group-request-5",33 * "description": "Welcome to the group! You can connect with other members, get updates and share videos.",34 * "privacyStatus": "PRIVATE",35 * "coverImage": {36 * "imageUrl": "wix:image://v1/jb9074e348009011fa9f2dzj0jn~mv2.jpg/nutmeg.jpg#originWidth=800&originHeight=720",37 * "position": {38 * "x": 66,39 * "y": 1040 * }41 * },42 * "memberTitle": "Co-workers",43 * "memberCount": 1,44 * "settings": {45 * "groupUpdatePostEnabled": true,46 * "membersCanApprove": false,47 * "membersCanInvite": true,48 * "showMemberList": true,49 * "welcomeMemberPostEnabled": true50 * },51 * "lastActivityDate": "Sun Sep 26 2021 08:23:23 GMT+0300",52 * "_createdDate": "Sun Sep 26 2021 08:23:23 GMT+0300",53 * "_updatedDate": "Sun Sep 26 2021 08:23:23 GMT+0300",54 * "owner": "9ne8e9e1-d050-4c86-9684-e7f231600a34"55 * }56 * }57 * ]58 * }59 */
Reject a request to create a group (export from backend code)
Copy Code
1import { Permissions, webMethod } from 'wix-web-module';2import { createRequests } from 'wix-groups.v2';34// Sample rejections value:5// [6// {7// groupRequestId: '77490611-53bb-4b47-a7cc-ca9a1335133b',8// reason: 'This group is for teachers only'9// }10// ]11//1213export const myRejectGroupRequestsFunction = webMethod(Permissions.Anyone, (rejections) => {14 return createRequests.rejectGroupRequests(rejections)15 .then((rejectedGroupRequests) => {16 return rejectedGroupRequests;17 })18 .catch((error) => {19 console.error(error);20 });21});2223/* Promise resolves to:24 * {25 * "groupRequest": [26 * {27 * "_id": "77490611-53bb-4b47-a7cc-ca9a1335133b",28 * "status": "REJECTED",29 * "rejectionReason": "This group is for teachers only.",30 * "group": {31 * "_id": "77490611-53bb-4b47-a7cc-ca9a1335133b",32 * "name": "My Group Request 5",33 * "slug": "my-group-request-5",34 * "description": "Welcome to the group! You can connect with other members, get updates and share videos.",35 * "privacyStatus": "PRIVATE",36 * "coverImage": {37 * "imageUrl": "wix:image://v1/jb9074e348009011fa9f2dzj0jn~mv2.jpg/nutmeg.jpg#originWidth=800&originHeight=720",38 * "position": {39 * "x": 66,40 * "y": 1041 * }42 * },43 * "memberTitle": "Co-workers",44 * "memberCount": 1,45 * "settings": {46 * "groupUpdatePostEnabled": true,47 * "membersCanApprove": false,48 * "membersCanInvite": true,49 * "showMemberList": true,50 * "welcomeMemberPostEnabled": true51 * },52 * "lastActivityDate": "Sun Sep 26 2021 08:23:23 GMT+0300",53 * "_createdDate": "Sun Sep 26 2021 08:23:23 GMT+0300",54 * "_updatedDate": "Sun Sep 26 2021 08:23:23 GMT+0300",55 * "owner": "9ne8e9e1-d050-4c86-9684-e7f231600a34"56 * }57 * }58 * ]59 * }60 */61