feat: add amazon seller filter to product list and result parsing
This commit is contained in:
@@ -150,6 +150,7 @@ function parseResultFilters(
|
||||
const sellabilityStatus = filters.get("sellabilityStatus")?.trim();
|
||||
const minConfidence = filters.get("minConfidence")?.trim();
|
||||
const maxConfidence = filters.get("maxConfidence")?.trim();
|
||||
const amazonIsSeller = filters.get("amazonIsSeller")?.trim();
|
||||
|
||||
const conditions: string[] = ["run_id = ?"];
|
||||
const params: Array<string | number> = [runId];
|
||||
@@ -174,6 +175,12 @@ function parseResultFilters(
|
||||
params.push(Number(maxConfidence));
|
||||
}
|
||||
|
||||
if (amazonIsSeller === "yes") {
|
||||
conditions.push("amazon_is_seller = 1");
|
||||
} else if (amazonIsSeller === "no") {
|
||||
conditions.push("amazon_is_seller = 0");
|
||||
}
|
||||
|
||||
if (q) {
|
||||
const wildcard = `%${q}%`;
|
||||
if (processType === "lead_analysis") {
|
||||
@@ -310,6 +317,7 @@ function getRuns(filters: URLSearchParams) {
|
||||
function getProductList(filters: URLSearchParams) {
|
||||
const q = filters.get("q")?.trim() || "";
|
||||
const verdict = filters.get("verdict")?.trim();
|
||||
const amazonIsSeller = filters.get("amazonIsSeller")?.trim();
|
||||
const page = parseIntParam(filters.get("page"), 1);
|
||||
const pageSize = Math.min(
|
||||
parseIntParam(filters.get("pageSize"), DEFAULT_PAGE_SIZE),
|
||||
@@ -325,6 +333,12 @@ function getProductList(filters: URLSearchParams) {
|
||||
params.push(verdict);
|
||||
}
|
||||
|
||||
if (amazonIsSeller === "yes") {
|
||||
conditions.push("amazon_is_seller = 1");
|
||||
} else if (amazonIsSeller === "no") {
|
||||
conditions.push("amazon_is_seller = 0");
|
||||
}
|
||||
|
||||
if (q) {
|
||||
const wildcard = `%${q}%`;
|
||||
conditions.push(
|
||||
|
||||
Reference in New Issue
Block a user