Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
johnkim-det committed Oct 30, 2024
1 parent 686d8ff commit 0646084
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions master/internal/api_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func (a *apiServer) GetUsers(
ColumnExpr("h.gid AS agent_gid").
ColumnExpr("h.user_ AS agent_user").
ColumnExpr("h.group_ AS agent_group")

if req.Name != "" {
nameFilterExpr := "%" + req.Name + "%"
query.Where("u.display_name ILIKE ? OR u.username ILIKE ?", nameFilterExpr, nameFilterExpr)
Expand Down Expand Up @@ -198,8 +198,8 @@ func (a *apiServer) GetUsers(
if sortColumn == "name" {
// ensure lexicographical sort:
query.OrderExpr("COALESCE(u.display_name, u.username) COLLATE \"C\" " + orderBy)
} else {
query.OrderExpr("? ?", bun.Ident(sortColumn), bun.Safe(orderBy))
} else {
query.OrderExpr("? ?", bun.Ident(sortColumn), bun.Safe(orderBy))
}
if sortColumn != "id" {
query.OrderExpr("id asc")
Expand Down

0 comments on commit 0646084

Please sign in to comment.