Lists requests to join a group.
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:
function listJoinGroupRequests(
groupId: string,
options: ListJoinGroupRequestsOptions,
): Promise<ListJoinGroupRequestsResponse>;
ID of the group requested to join.
import { joinGroupRequests } from "wix-groups.v2";
// Sample groupId: 'fc3df3c1-36b2-4279-8be1-8e72a05a88c8'
async function listJoinGroupRequests(groupId, options) {
try {
const result = await joinGroupRequests.listJoinGroupRequests(groupId);
return result;
} catch (error) {
console.error(error);
// Handle the error
}
}
/* Promise resolves to:
* joinGroupRequests: [
* {
* "requestDetails": {"rejectionReason": "none"}
* "siteMemberId": "124cd3db-e9be-4980-93c1-a6d767a11099"
* "status": "REJECTED"
* },
* {
* "requestDetails": {}
* "siteMemberId": "2f48e9e1-d050-4c86-9684-e7f231600f29"
* "status": "APPROVED"
* }
* ]
* metadata:
* {
* "count": 2
* "offset": 0
* "tooManyToCount": false
* "total": 2
* }
*/
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.