fix(api): parse price filters as dollars
This commit is contained in:
@@ -3,6 +3,7 @@ import { logger } from "../logger";
|
||||
import {
|
||||
emptySearchResponse,
|
||||
getRequiredSearchQuery,
|
||||
parseDollarPriceParam,
|
||||
parseNonNegativeIntegerParam,
|
||||
} from "./helpers";
|
||||
|
||||
@@ -26,17 +27,11 @@ export async function kijijiRoute(req: Request): Promise<Response> {
|
||||
if (maxPages instanceof Response) {
|
||||
return maxPages;
|
||||
}
|
||||
const priceMin = parseNonNegativeIntegerParam(
|
||||
reqUrl.searchParams,
|
||||
"priceMin",
|
||||
);
|
||||
const priceMin = parseDollarPriceParam(reqUrl.searchParams, "priceMin");
|
||||
if (priceMin instanceof Response) {
|
||||
return priceMin;
|
||||
}
|
||||
const priceMax = parseNonNegativeIntegerParam(
|
||||
reqUrl.searchParams,
|
||||
"priceMax",
|
||||
);
|
||||
const priceMax = parseDollarPriceParam(reqUrl.searchParams, "priceMax");
|
||||
if (priceMax instanceof Response) {
|
||||
return priceMax;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user