feat: add catalog status filters
Quality / test (push) Canceled after 0s

This commit is contained in:
2026-09-10 03:02:23 -04:00
parent 673701fa7a
commit c9ad3a11af
12 changed files with 114 additions and 7 deletions
@@ -22,6 +22,8 @@ export function createSearchQuery({
setName,
eventName,
tag,
status,
newlyAdded = false,
minPriceMinor,
maxPriceMinor,
page = 1,
@@ -39,6 +41,10 @@ export function createSearchQuery({
throw new Error("limit must be between 1 and 100");
}
if (status && !["AVAILABLE", "PENDING", "SOLD", "ALL"].includes(status)) {
throw new Error("status must be AVAILABLE, PENDING, SOLD, or ALL");
}
if (
typeof minPriceMinor !== "undefined" &&
(!Number.isInteger(minPriceMinor) || minPriceMinor < 0)
@@ -87,6 +93,8 @@ export function createSearchQuery({
page,
limit,
includeSold,
...(status ? { status } : {}),
...(newlyAdded ? { newlyAdded: true } : {}),
...(sort !== "recent" ? { sort } : {}),
};
}