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()
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++
}
}
}