MCPcopy Create free account
hub / github.com/alanagoyal/docbase / handleRemoveGroup

Function handleRemoveGroup

components/groups-form.tsx:93–105  ·  view source on GitHub ↗
(id: string)

Source from the content-addressed store, hash-verified

91 }
92
93 const handleRemoveGroup = async (id: string) => {
94 const { error } = await supabase.from("groups").delete().eq("id", id)
95
96 if (error) {
97 clientLogger.error('Error removing group', { error })
98 toast({ variant: "destructive", description: "Failed to remove group" })
99 } else {
100 setGroups(groups.filter((group) => group.id !== id))
101 setHasChanges(true)
102 router.refresh()
103 toast({ description: "Group removed successfully" })
104 }
105 }
106
107 const handleAddGroup = async () => {
108 const newColor = getColorForGroup(groups.length)

Callers 1

GroupsDialogFunction · 0.85

Calls 1

toastFunction · 0.90

Tested by

no test coverage detected