This commit is contained in:
@@ -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 } : {}),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user