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 (dashboard page code)
Copy Code
1import { members } from 'wix-groups.v2';23// Sample groupId: '0261a737-2361-4468-a3b1-5ec2b0667836'4//5// Sample memberIds: ['937cd3db-e9be-4980-93c1-a6d767a11050', '7fe8e9e1-d050-4c86-9684-e7f231600a34']67 async function removeGroupMembers(groupId, memberIds, options) {8 try {9 const result = await members.removeGroupMembers(groupId, memberIds);1011 return result;12 } catch (error) {13 console.error(error);14 // Handle the error15 }16 }17
Remove a site member from a group (export from backend code)
Copy Code
1import { Permissions, webMethod } from 'wix-web-module';2import { members } from 'wix-groups.v2';34// Sample groupId: '0261a737-2361-4468-a3b1-5ec2b0667836'5//6// Sample memberIds: ['937cd3db-e9be-4980-93c1-a6d767a11050', '7fe8e9e1-d050-4c86-9684-e7f231600a34']78export const removeGroupMembers = webMethod(Permissions.Anyone, async (groupId, memberIds, options) => {9 try {10 const result = await members.removeGroupMembers(groupId, memberIds);1112 return result;13 } catch (error) {14 console.error(error);15 // Handle the error16 }17});