fix: avoid null value

This commit is contained in:
2025-06-25 11:54:19 +02:00
parent d5e86acacf
commit a83ec61fae

View File

@ -39,17 +39,16 @@ func (h *AdminHandler) GetAllPermissions(w http.ResponseWriter, r *http.Request)
return
}
log.Println("DEBUG: Appending row dto:", RowDTO{
Scope: row.Scope,
Permissions: permissions,
})
mapped = append(mapped, RowDTO{
Scope: row.Scope,
Permissions: permissions,
})
}
if len(mapped) == 0 {
mapped = make([]RowDTO, 0)
}
encoder := json.NewEncoder(w)
w.Header().Set("Content-Type", "application/json")