From 99e223472e6bb3b7e1d3b9c2d8a450a19993a7bb Mon Sep 17 00:00:00 2001 From: Liam Burnand Date: Thu, 22 Aug 2024 01:41:10 +0100 Subject: [PATCH] Improving director sorting --- officership/db.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/officership/db.go b/officership/db.go index 476d82e..f8391c8 100644 --- a/officership/db.go +++ b/officership/db.go @@ -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 @@ -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