Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion api/src/routes/mcp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -618,8 +618,14 @@ async function handleGetDeals(args: Record<string, unknown>) {
// params already has: currency, minDiscount, [region], [country]
// Add limit and offset
const queryParams = [...params, Number(limit) || 20, Number(offset) || 0];
// BUY-66091: products has no `domain` or `original_price` columns (domain is on
// merchants; original_price lives in metadata JSONB). `buildProduct` reads
// row.domain / row.original_price, so alias them — mirroring the REST
// /v1/products/deals SELECT (products.ts). The prior bare-column form threw
// `column "domain" does not exist`.
const dataResult = await dealsClient.query(
`SELECT id, source, domain, url, title, price, original_price,
`SELECT id, source AS domain, url, title, price,
(metadata->>'original_price')::numeric AS original_price,
currency, image_url, metadata, updated_at, region, country_code,
${discountSelect}
FROM products
Expand Down
8 changes: 7 additions & 1 deletion mcp-railway/src/routes/mcp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -642,8 +642,14 @@ async function handleGetDeals(args: Record<string, unknown>) {
// params already has: currency, minDiscount, [region], [country]
// Add limit and offset
const queryParams = [...params, Number(limit) || 20, Number(offset) || 0];
// BUY-66091: products has no `domain` or `original_price` columns (domain is on
// merchants; original_price lives in metadata JSONB). `buildProduct` reads
// row.domain / row.original_price, so alias them — mirroring the REST
// /v1/products/deals SELECT (products.ts). The prior bare-column form threw
// `column "domain" does not exist`.
const dataResult = await dealsClient.query(
`SELECT id, source, domain, url, title, price, original_price,
`SELECT id, source AS domain, url, title, price,
(metadata->>'original_price')::numeric AS original_price,
currency, image_url, metadata, updated_at, region, country_code,
${discountSelect}
FROM products
Expand Down
Loading