feat: add user search query param on last_seen (#8139)

* feat: add sql filter for before/after on last_seen column
This commit is contained in:
Steven Masley
2023-06-22 15:24:48 -05:00
committed by GitHub
parent 97945ae272
commit f56db1b41b
10 changed files with 200 additions and 33 deletions
+11
View File
@@ -181,6 +181,17 @@ WHERE
rbac_roles && @rbac_role :: text[]
ELSE true
END
-- Filter by last_seen
AND CASE
WHEN @last_seen_before :: timestamp with time zone != '0001-01-01 00:00:00Z' THEN
last_seen_at <= @last_seen_before
ELSE true
END
AND CASE
WHEN @last_seen_after :: timestamp with time zone != '0001-01-01 00:00:00Z' THEN
last_seen_at >= @last_seen_after
ELSE true
END
-- End of filters
ORDER BY
-- Deterministic and consistent ordering of all users. This is to ensure consistent pagination.