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

Function handleAddGroup

components/groups-form.tsx:107–121  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

105 }
106
107 const handleAddGroup = async () => {
108 const newColor = getColorForGroup(groups.length)
109 const { data, error } = await supabase
110 .from("groups")
111 .insert({ name: "", color: newColor, created_by: userId })
112 .select()
113
114 if (error) {
115 clientLogger.error('Error adding group', { error })
116 } else if (data) {
117 setGroups([...groups, data[0]])
118 setNewGroupId(data[0].id)
119 setHasChanges(true)
120 }
121 }
122
123 const handleColorChange = (id: string, color: HslColor) => {
124 const hslString = `hsl(${color.h}, ${color.s}%, ${color.l}%)`

Callers

nothing calls this directly

Calls 1

getColorForGroupFunction · 0.90

Tested by

no test coverage detected