Search.../

removeGroupMembers( )

Removes members from a group.

Description

The removeGroupMembers() function returns a Promise that resolves when the member is removed from the group.

Note: Only site admins and group admins can remove members from their group. However, if the suppressAuth option is set to true, all permissions are overwritten and all site members (including non-group members) can remove members from a group.

Syntax

function removeGroupMembers(identifiers: IdentifiersRemoveGroupMembers, [options: Options]): Promise<void>

removeGroupMembers Parameters

NAME
TYPE
DESCRIPTION
identifiers
IdentifiersRemoveGroupMembers

Group ID and member IDs.

options
Optional
Options

Authorization options.

Returns

Return Type:

Promise<void>

Was this helpful?

Remove a site member from a group

Copy Code
1import { members } from 'wix-groups-backend';
2
3// Sample identifiers value:
4// {
5// groupId: '0261a737-2361-4468-a3b1-5ec2b0667836',
6// memberIds: ['937cd3db-e9be-4980-93c1-a6d767a11050', '7fe8e9e1-d050-4c86-9684-e7f231600a34']
7// }
8//
9// Sample options value:
10// {
11// suppressAuth: true
12// }
13
14export function myRemoveGroupMembersFunction(identifiers, options) {
15 return members.removeGroupMembers(identifiers, options)
16 .then((removedGroupMembers) => {
17 console.log('Removed group members');
18 })
19 .catch((error) => {
20 console.error(error);
21 });
22}