Unassigns a role from group members.
You can only unassign ADMIN
roles. Calling this method with group members
with role.value
set to MEMBER
returns an error.
Notes:
function unassignRole(
groupId: string,
memberIds: Array<string>,
role: GroupRole,
options: UnassignRoleOptions,
): Promise<UnassignRoleResponse>;
Group ID.
Member IDs. Limited to 100 member IDs. See the Members API for details.
Role to unassign.
import { roles } from "wix-groups.v2";
// Sample ID values:
// memberIds: ['7fe8e9e1-d050-4c86-9684-e7f231600a34'],
// groupId: '0261a737-2361-4468-a3b1-5ec2b0667836.'
//
// Sample role value:
// role: 'MEMBER'
//
export function unassignRole(groupId, memberIds, role) {
return roles
.unassignRole(groupId, memberIds, role)
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
}
/* Promise resolves to:
* role: "MEMBER"
*/
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.