Search...
deleteGroup( )
Deletes a group.
Description
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.
Admin Method
This function requires elevated permissions to run. This function is not universal and runs only on the backend.
Syntax
function deleteGroup(groupId: string): Promise<DeleteGroupResponse>
deleteGroup Parameters
NAME
TYPE
DESCRIPTION
groupId
string
ID of the group to delete.
Returns
Return Type:
Promise<
DeleteGroupResponse
>NAME
TYPE
DESCRIPTION
group
Group
Deleted group.
Was this helpful?
deleteGroup example
Copy Code
1import { groups } from 'wix-groups.v2';23 async function deleteGroup(groupId) {4 try {5 const result = await groups.deleteGroup(groupId);67 return result;8 } catch (error) {9 console.error(error);10 // Handle the error11 }12 }13