Deletes a group.
The deleteGroup()
function returns a Promise resolves to the deleted group after it has successfully been deleted. Only site admins and group admins can delete their group. After the group is deleted, it is removed from both your site and the site's Dashboard.
function deleteGroup(groupId: string): Promise<DeleteGroupResponse>;
ID of the group to delete.
import { groups } from "wix-groups.v2";
async function deleteGroup(groupId) {
try {
const result = await groups.deleteGroup(groupId);
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.