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.

Admin Method

This function requires elevated permissions to run. This function is not universal and runs only on the backend.

Syntax

function removeGroupMembers(groupId: string, memberIds: Array<string>): Promise<void>

removeGroupMembers Parameters

NAME
TYPE
DESCRIPTION
groupId
string

Group ID.

memberIds
Array<
string
>

IDs of the site members to remove from the group.

Returns

Return Type:

Promise<
void
>

Was this helpful?

Remove a site member from a group

Copy Code
1
2// Sample groupId: '0261a737-2361-4468-a3b1-5ec2b0667836'
3//
4// Sample memberIds: ['937cd3db-e9be-4980-93c1-a6d767a11050', '7fe8e9e1-d050-4c86-9684-e7f231600a34']
5
6
7import { members } from 'wix-groups.v2';
8
9 async function removeGroupMembers(groupId, memberIds, options) {
10 try {
11 const result = await members.removeGroupMembers(groupId, memberIds);
12
13 return result;
14 } catch (error) {
15 console.error(error);
16 // Handle the error
17 }
18 }
19