Skip to content

Commit

Permalink
Improving director sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
COMTOP1 committed Aug 22, 2024
1 parent f90590f commit 99e2234
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions officership/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ func (s *Store) getOfficershipTeamMembers(ctx context.Context, t1 *OfficershipTe
}

builder = builder.OrderBy(`CASE WHEN o.name = 'Station Director' THEN 0
WHEN o.name LIKE '%Director%' AND o.name NOT LIKE '%Deputy%' THEN 1
WHEN o.name LIKE '%Director%' AND o.name NOT LIKE '%Deputy%' AND o.name NOT LIKE '%Assistant%' THEN 1
WHEN o.name LIKE '%Deputy%' THEN 2
WHEN o.name LIKE '%Assistant%' THEN 3
WHEN o.name = 'Head of Welfare and Training' THEN 4
Expand Down Expand Up @@ -525,7 +525,7 @@ func (s *Store) getOfficershipMembers(ctx context.Context, o1 *Officership, u *u

if orderByOfficerName {
builder = builder.OrderBy(`CASE WHEN o.name = 'Station Director' THEN 0
WHEN o.name LIKE '%Director%' AND o.name NOT LIKE '%Deputy%' THEN 1
WHEN o.name LIKE '%Director%' AND o.name NOT LIKE '%Deputy%' AND o.name NOT LIKE '%Assistant%' THEN 1
WHEN o.name LIKE '%Deputy%' THEN 2
WHEN o.name LIKE '%Assistant%' THEN 3
WHEN o.name = 'Head of Welfare and Training' THEN 4
Expand Down

0 comments on commit 99e2234

Please sign in to comment.