Updates a group.
The updateGroup()
function returns a Promise that resolves to the updated group. Only site admins and group admins can update their group. Only the fields in the groupInfo object parameter can be updated. Specify which fields to update. Unspecified fields remain the same.
Notes:
privacyStatus
is updated from PRIVATE
to PUBLIC
, all pending join requests for that group are automatically approved.privacyStatus
is updated from PRIVATE
to SECRET
, all pending join requests for that group are automatically rejected.function updateGroup(
_id: string,
group: UpdateGroup,
options: UpdateGroupOptions,
): Promise<Group>;
Group ID.
import { groups } from "wix-groups.v2";
async function updateGroup(id, group, options) {
try {
const result = await groups.updateGroup(id, group, options);
return result;
} catch (error) {
console.error(error);
// Handle the error
}
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.