[management] fix groups delete and resource create and update error response (#3189)

This commit is contained in:
Pascal Fischer
2025-01-16 13:39:15 +01:00
committed by GitHub
parent 992a6c79b4
commit c6f7a299a9
4 changed files with 12 additions and 8 deletions

View File

@@ -239,8 +239,9 @@ func (h *handler) deleteGroup(w http.ResponseWriter, r *http.Request) {
err = h.accountManager.DeleteGroup(r.Context(), accountID, userID, groupID)
if err != nil {
_, ok := err.(*server.GroupLinkError)
if ok {
wrappedErr, ok := err.(interface{ Unwrap() []error })
if ok && len(wrappedErr.Unwrap()) > 0 {
err = wrappedErr.Unwrap()[0]
util.WriteErrorResponse(err.Error(), http.StatusBadRequest, w)
return
}