This commit is contained in:
gitGnome
2026-03-31 20:57:05 +02:00
parent 23cd966eee
commit caab2e22bc
2 changed files with 38 additions and 0 deletions
+28
View File
@@ -342,4 +342,32 @@ func HttpHandleGroupsGeWithoutMembers(response http.ResponseWriter, request *htt
ctx := request.Context() ctx := request.Context()
client, err := CacheGetClientById(clientId)
if err != nil {
client = &Client{Id: clientId}
err = DbSetClientById(ctx, client)
if err != nil {
http.Error(response, "invalid token", http.StatusUnauthorized)
return
}
CacheSaveClient(client)
}
var groups [MaxGroupsForClient]*Group
var i uint32
for groupId := range client.Groups {
group, err := CacheGetGroup(groupId)
if err != nil {
group = &Group{Id: groupId}
err = DbSetClientByIdWithoutGroups(ctx, client)
if err != nil {
http.Error(response, "internal server error", http.StatusInternalServerError)
return
}
groups[i] = group
i++
}
}
} }
+10
View File
@@ -27,3 +27,13 @@ type Group struct {
Color [3]uint8 Color [3]uint8
EnableClientColors bool EnableClientColors bool
} }
type GroupNoMembers struct {
Name string
CreatedAt time.Time
Id uint32
CreatorId uint32
OwnerId uint32
Color [3]uint8
EnableClientsColors bool
}