feat: enhance product analysis results with additional fields and update handling logic
This commit is contained in:
@@ -31,6 +31,8 @@ type ProductListRecord = {
|
||||
seller_count: number | null;
|
||||
sales_rank: number | null;
|
||||
current_price: number | null;
|
||||
avg_price_90d: number | null;
|
||||
reasoning: string | null;
|
||||
fetched_at: string;
|
||||
};
|
||||
|
||||
@@ -286,6 +288,11 @@ function getProductList(filters: URLSearchParams) {
|
||||
"sales_rank",
|
||||
"current_price",
|
||||
"product_name",
|
||||
"brand",
|
||||
"category",
|
||||
"avg_price_90d",
|
||||
"confidence",
|
||||
"reasoning",
|
||||
"fetched_at",
|
||||
]);
|
||||
const orderBy = parseResultSort(
|
||||
@@ -309,6 +316,8 @@ function getProductList(filters: URLSearchParams) {
|
||||
sellers AS seller_count,
|
||||
sales_rank,
|
||||
current_price,
|
||||
avg_price_90d,
|
||||
reasoning,
|
||||
fetched_at
|
||||
FROM results
|
||||
UNION ALL
|
||||
@@ -326,6 +335,8 @@ function getProductList(filters: URLSearchParams) {
|
||||
seller_count,
|
||||
sales_rank,
|
||||
current_price,
|
||||
avg_price_90d,
|
||||
reasoning,
|
||||
fetched_at
|
||||
FROM product_analysis_results
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user