Search...
listJoinGroupRequests( )
Lists requests to join a group.
Description
Note: This function is only relevant for private groups.
The listjoinGroupRequests()
function returns a Promise that resolves to a list of up to 100 requests to join a group. Sorts by default to _createdDate
in descending order.
Only site admins and group admins can see requests to join their group. Site members can access their own join requests in their site.
Notes:
Admin Method
This function requires elevated permissions to run. This function is not universal and runs only on the backend.
Syntax
function listJoinGroupRequests(groupId: string, options: ListJoinGroupRequestsOptions): Promise<ListJoinGroupRequestsResponse>
listJoinGroupRequests Parameters
NAME
TYPE
DESCRIPTION
groupId
string
ID of the group requested to join.
options
Optional
ListJoinGroupRequestsOptions
Returns
Return Type:
Promise<
ListJoinGroupRequestsResponse
>NAME
TYPE
DESCRIPTION
joinGroupRequests
Array<
JoinGroupRequest
>Join group requests.
metadata
PagingMetadata
Was this helpful?
List all requests to join a group (dashboard page code)
Copy Code
1import { joinGroupRequests } from 'wix-groups.v2';23// Sample groupId: 'fc3df3c1-36b2-4279-8be1-8e72a05a88c8'45 async function listJoinGroupRequests(groupId, options) {6 try {7 const result = await joinGroupRequests.listJoinGroupRequests(groupId);89 return result;10 } catch (error) {11 console.error(error);12 // Handle the error13 }14 }1516 /* Promise resolves to:17 * joinGroupRequests: [18 * {19 * "requestDetails": {"rejectionReason": "none"}20 * "siteMemberId": "124cd3db-e9be-4980-93c1-a6d767a11099"21 * "status": "REJECTED"22 * },23 * {24 * "requestDetails": {}25 * "siteMemberId": "2f48e9e1-d050-4c86-9684-e7f231600f29"26 * "status": "APPROVED"27 * }28 * ]29 * metadata:30 * {31 * "count": 232 * "offset": 033 * "tooManyToCount": false34 * "total": 235 * }36 */
List all requests to join a group (export from backend code)
Copy Code
1import { Permissions, webMethod } from 'wix-web-module';2import { joinGroupRequests } from 'wix-groups.v2';34// Sample groupId: 'fc3df3c1-36b2-4279-8be1-8e72a05a88c8'56export const listJoinGroupRequests = webMethod(Permissions.Anyone, async (groupId) => {7 try {8 const result = await joinGroupRequests.listJoinGroupRequests(groupId);910 return result;11 } catch (error) {12 console.error(error);13 // Handle the error14 }15});1617/* Promise resolves to:18 * joinGroupRequests: [19 * {20 * "requestDetails": {"rejectionReason": "none"}21 * "siteMemberId": "124cd3db-e9be-4980-93c1-a6d767a11099"22 * "status": "REJECTED"23 * },24 * {25 * "requestDetails": {}26 * "siteMemberId": "2f48e9e1-d050-4c86-9684-e7f231600f29"27 * "status": "APPROVED"28 * }29 * ]30 * metadata:31 * {32 * "count": 233 * "offset": 034 * "tooManyToCount": false35 * "total": 236 * }37 */38
List some requests to join a group using paging options
Copy Code
1import { Permissions, webMethod } from 'wix-web-module';2import { joinGroupRequests } from 'wix-groups.v2';34// Sample groupId: 'fc3df3c1-36b2-4279-8be1-8e72a05a88c8'5//6// Sample options value:7// {8// limit: 29// offset: 210// }1112export const listJoinGroupRequests = webMethod(Permissions.Anyone, async (groupId, options) => {13 try {14 const result = await joinGroupRequests.listJoinGroupRequests(groupId, options);1516 return result;17 } catch (error) {18 console.error(error);19 // Handle the error20 }21});2223/* Promise resolves to:24 * joinGroupRequests: [25 * {26 * "requestDetails": {"rejectionReason": "Wrong group."}27 * "siteMemberId": "7fe8e9e1-d050-4c86-9684-e7f231600a34"28 * "status": "REJECTED"29 * },30 * {31 * "requestDetails": {}32 * "siteMemberId": "937cd3db-e9be-4980-93c1-a6d767a11050"33 * "status": "APPROVED"34 * }35 * ]36 * metadata:37 * {38 * "count": 239 * "offset": 240 * "tooManyToCount": false41 * "total": 542 * }43 */44