listCreateRequests( )


Lists requests to create a group.

Note: This function is only relevant if admin approval is required for creating a group, or if the function's suppressAuth option is set to true.

The listCreateRequests() function returns a Promise that resolves to a list of up to 1,000 create requests on your site. Sorts by default to _createdDate in descending order. Only site admins can see create requests. Site members can access their own create requests in their site.

Notes:

  • If the suppressAuth option is set to true, all permissions are overwritten, and all site members can see create requests.
  • This function's parameters are positional, and must be specified in the sequence shown in the syntax below. When specifying a parameter, use null as a placeholder for any unspecified parameters. For example, to specify limit only, call listCreateRequests(paging, null). To specify supressAuth only, call listCreateRequests(null, options).
Method Declaration
Copy
function listCreateRequests(
  paging: Paging,
  options: Options,
): Promise<ListCreateRequests>;
Method Parameters
pagingPaging

Paging options.


optionsOptions

Authorization options.

Returns
Return Type:Promise<ListCreateRequests>
JavaScript
import { Permissions, webMethod } from "wix-web-module"; import { createRequests } from "wix-groups-backend"; export const myListCreateRequestsFunction = webMethod( Permissions.Anyone, () => { return createRequests .listCreateRequests() .then((createRequestsResults) => { const createRequestStatus = createRequestsResults.createRequests[0].status; const createRequestName = createRequestsResults.createRequests[0].group.name; return createRequestsResults; }) .catch((error) => { console.error(error); }); }, ); /* Promise resolves to: * createRequests: [ * { * "_id": "83636377-b415-4ebe-ba41-df338c5ad6b7" * "status": "PENDING", * "group": { * "_id": "83636377-b415-4ebe-ba41-df338c5ad6b7" * "name": "My Group Request 1" * "slug": "my-group-request-1" * "description": "Welcome to the group! You can connect with other members, get updates and share videos." * "privacyStatus": "PUBLIC" * "coverImage": { * "imageUrl": "wix:image://v1/22j9074e348009011fa9f2d2961b~mv2.jpg/corn.jpg#originWidth=112&originHeight=224", * "position": { * "x": 80, * "y": 53 * } * } * "memberTitle": "Employees" * "memberCount": 1 * "settings": { * "groupUpdatePostEnabled": true * "membersCanApprove": false * "membersCanInvite": true * "showMemberList": true * "welcomeMemberPostEnabled": true * } * "lastActivityDate": "Sun Sep 26 2021 08:23:23 GMT+0300" * "_createdDate": "Tues January 22 2021 12:56:02 GMT+0300" * "_updatedDate": "Fri October 2 2021 04:56:22 GMT+0300" * "owner": "9ne8e9e1-d050-4c86-9684-e7f231600a34" * } * }, * { * "_id": "6ff5333-b477-4e9tt-ba4j-df338c5ad6221" * "status": "APPROVED", * "group": { * "_id": "6ff5333-b477-4e9tt-ba4j-df338c5ad6221" * "name": "My Group Request 2" * "slug": "my-group-request-2" * "description": "Welcome to the group! You can connect with other members, get updates and share videos." * "privacyStatus": "PRIVATE" * "coverImage": { * "imageUrl": "wix:image://v1/664e64e348009011fa9f2d2961e~mv2.jpg/time.jpg#originWidth=2922&originHeight=778", * "position": { * "x": 0, * "y": 0 * } * } * "memberTitle": "Friends" * "memberCount": 65 * "settings": { * "groupUpdatePostEnabled": true * "membersCanApprove": true * "membersCanInvite": true * "showMemberList": false * "welcomeMemberPostEnabled": true * } * "lastActivityDate": "Thurs Nov 12 2020 11:13:03 GMT+0300" * "_createdDate": "Wed May 14 2020 10:05:20 GMT+0300" * "_updatedDate": "Sun June 7 2020 09:07:33 GMT+0300" * "owner": "abe5e4e1-d950-4c46-8884-e7f231600d67" * } * } * "_id": "57vn211-b477-4e9tt-ba4j-df338c5adf337" * "status": "REJECTED" * "rejectionReason": "This group has inappropriate content.", * "group": { * "_id": "57vn211-b477-4e9tt-ba4j-df338c5adf337" * "name": "My Group Request 3" * "slug": "my-group-request-3" * "description": "Welcome to the group! You can connect with other members, get updates and share videos." * "privacyStatus": "PRIVATE" * "coverImage": { * "imageUrl": "wix:image://v1/ff9074e348009011fa9f2d2961b~mv2.jpg/popcorn.jpg#originWidth=712&originHeight=667", * "position": { * "x": 44, * "y": 15 * } * } * "memberTitle": "Students" * "memberCount": 1 * "settings": { * "groupUpdatePostEnabled": true * "membersCanApprove": true * "membersCanInvite": true * "showMemberList": false * "welcomeMemberPostEnabled": true * } * "lastActivityDate": "Mon Feb 04 2019 01:19:53 GMT+0300" * "_createdDate": "Mon Feb 04 2019 01:19:53 GMT+0300" * "_updatedDate": "Mon Feb 04 2019 01:19:53 GMT+0300" * "owner": "abe5e4e1-d950-4c46-8884-e7f231600d67" * } * } * ], * metadata: * { * "length": 3 * "tooManyToCount": false * "totalCount": 3 * } */
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?