Search.../

items

Returns the items that match the query.

Description

The current page of join requests retrieved by the query.

Note: When no items match the query, the items array is empty.

To paginate your query results, use the JoinRequestsQueryResult pagination properties and functions.

Type:

Array<JoinRequest>Read Only
NAME
TYPE
DESCRIPTION
memberId
string

Site member ID of the requester.

_createdDate
Date

Date the site member requested to join the group.

status
string

Status of the request to join a group. One of:

  • "PENDING"
  • "APPROVED"
  • "REJECTED"
rejectionReason
string

Reason the request to join a group was rejected.

Was this helpful?

Perform a query and get the returned items from the result

Copy Code
1import { Permissions, webMethod } from 'wix-web-module';
2import { joinRequests } from 'wix-groups-backend';
3
4/* Sample options value:
5 * {
6 * suppressAuth: true
7 * }
8 * Sample groupId value:
9 * 'c5c8baa7-b3cd-457f-b4a7-6178327834c7'
10 */
11
12export const getQueryResultItems = webMethod(Permissions.Anyone, () => {
13 return joinRequests.queryJoinRequests()
14 .limit(3)
15 .find({ "groupId": groupId, options })
16 .then((results) => {
17 if (results.items.length > 0) {
18 return results.items;
19 } else {
20 console.log("No items found");
21 }
22 })
23 .catch((error) => {
24 console.error(error);
25 });
26});
27
28/* items:
29 * [
30 * {
31 * "memberId": "7fe8e9e1-d050-4c86-9684-e7f231600a34"
32 * "_createdDate": "Fri Oct 24 2021 22:45:50 GMT+0300"
33 * "status": "PENDING"
34 * },
35 * {
36 * "memberId": "937cd3db-e9be-4980-93c1-a6d767a11050"
37 * "_createdDate": "Wed May 14 2021 10:05:20 GMT+0300"
38 * "status": "REJECTED"
39 * "rejectionReason": "Wrong group"
40 * },
41 * {
42 * "memberId": "2CD58761-d050-4c86-9684-e7f2316229b3"
43 * "_createdDate": "Sun July 11 2020 03:25:30 GMT+0300"
44 * "status": "APPROVED"
45 * }
46 * ]
47 */