Sort domains alphabetically

- GetAllDomains: order by name ASC
- GetUserAccessibleDomains: order by name ASC for both admin and regular users
This commit is contained in:
Christoph Haas 2026-03-23 00:11:03 +01:00
parent c692fe436f
commit 36258bf53c
4 changed files with 11 additions and 9 deletions

View file

@ -1,6 +1,7 @@
package handlers
import (
"log"
"net/http"
"strconv"
@ -138,6 +139,7 @@ func (h *UserHandler) Create(c *gin.Context) {
user, err := h.db.CreateUserInDomain(req.Email, passwordHash, req.Quota, domain.ID)
if err != nil {
log.Printf("CreateUserInDomain error: email=%s, domain=%s, err=%v", req.Email, domainName, err)
Error(c, http.StatusInternalServerError, "failed to create user")
return
}