Search.../

listMemberBadges( )

Lists the badges assigned to each of the specified site members.

Description

The listMemberBadges() function returns a Promise that resolves to a list of badge IDs associated with each of the specified members.

Syntax

function listMemberBadges(memberIds: Array<string>): Promise<Array<MemberBadges>>

listMemberBadges Parameters

NAME
TYPE
DESCRIPTION
memberIds

Array<string>

IDs of the members to list badges for.

Returns

Fulfilled - An array of badge IDs associated with each member. Rejected - Error message.

Return Type:

Promise<Array<MemberBadges>>

Was this helpful?

List badges assigned to members

Code Example

Copy Code
1import {badges} from 'wix-users-backend';
2
3const memberIds = [
4 "32cf071a-cc2f-450f-ad74-5a25db0b1b6a",
5 "2cb1846f-0c7a-4c39-8736-349236cfab40"
6];
7
8export function listMemberBadges(memberIds) {
9 return badges.listMemberBadges(memberIds);
10}
11
12/*
13 * Returns a promise that resolves to:
14 *
15 * [
16 * {
17 * "memberId": "32cf071a-cc2f-450f-ad74-5a25db0b1b6a",
18 * "badgeIds": [
19 * "0d37ea22-44b0-4a62-9818-ff660178c439",
20 * "c7d1a81d-485a-4eef-872f-4595ab2a15a2"
21 * ]
22 * },
23 * {
24 * "memberId": "2cb1846f-0c7a-4c39-8736-349236cfab40",
25 * "badgeIds": [
26 * "0d37ea22-44b0-4a62-9818-ff660178c439",
27 * "41dcda59-8b6d-4deb-bb1f-d283de044b85",
28 * "df9fc0e2-c2ba-40ba-a160-200a016c3507"
29 * ]
30 * }
31 * ]
32 */