Assigns a specific role to group members.
Calling this method overrides the group member's current role.value
.
Notes:
function assignRole(
groupId: string,
memberIds: Array<string>,
role: GroupRole,
): Promise<AssignRoleResponse>;
Group ID.
Member IDs. Limited to 100 member IDs. See the Members API for details.
Role to assign.
import { roles } from "@wix/groups";
async function assignRole(groupId, memberIds, role) {
const response = await roles.assignRole(groupId, memberIds, role);
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.