Clean up some type guards

This commit is contained in:
Rory&
2026-03-14 04:09:37 +01:00
parent 6e8292508e
commit 0370985a4e
4 changed files with 6 additions and 9 deletions
@@ -56,7 +56,7 @@ router.get(
if (parsedLimit < 1 || parsedLimit > 100) throw new HTTPError("limit must be between 1 and 100", 422);
if (sort_order) {
if (typeof sort_order != "string" || ["desc", "asc"].indexOf(sort_order) == -1)
if (["desc", "asc"].indexOf(sort_order) == -1)
throw FieldErrors({
sort_order: {
message: "Value must be one of ('desc', 'asc').",