refactor: rename findLatestStalkerRunItemIdByAsin to findLatestRunItemIdByAsin and update references
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
"Bash(bun run build:web 2>&1 || true)",
|
||||
"Bash(bun run build:web 2>&1 || true)",
|
||||
"Bash(bun run build:web 2>&1 || true)",
|
||||
"Bash(bun run build:web 2>&1 || true)",
|
||||
"Bash(bun run build:web 2>&1 || true)"
|
||||
]
|
||||
},
|
||||
|
||||
@@ -531,13 +531,11 @@ async function getProduct(asin: string) {
|
||||
return { product, observations, analyses, distributorResearch };
|
||||
}
|
||||
|
||||
async function findLatestStalkerRunItemIdByAsin(asin: string): Promise<number | null> {
|
||||
async function findLatestRunItemIdByAsin(asin: string): Promise<number | null> {
|
||||
const row = await pgGet<{ id: number }>(
|
||||
`SELECT ri.id
|
||||
FROM run_items ri
|
||||
JOIN runs run ON run.id = ri.run_id
|
||||
WHERE ri.product_asin = ?
|
||||
AND run.type = 'stalker'
|
||||
ORDER BY ri.id DESC
|
||||
LIMIT 1`,
|
||||
[asin],
|
||||
@@ -546,7 +544,7 @@ async function findLatestStalkerRunItemIdByAsin(asin: string): Promise<number |
|
||||
}
|
||||
|
||||
async function reanalyzeStalkerProductByAsin(asin: string, useClaude = USE_CLAUDE) {
|
||||
const runItemId = await findLatestStalkerRunItemIdByAsin(asin);
|
||||
const runItemId = await findLatestRunItemIdByAsin(asin);
|
||||
if (runItemId == null) {
|
||||
throw new Error("Stalker product item not found");
|
||||
}
|
||||
@@ -554,7 +552,7 @@ async function reanalyzeStalkerProductByAsin(asin: string, useClaude = USE_CLAUD
|
||||
}
|
||||
|
||||
async function findDistributorsForStalkerProductByAsin(asin: string) {
|
||||
const runItemId = await findLatestStalkerRunItemIdByAsin(asin);
|
||||
const runItemId = await findLatestRunItemIdByAsin(asin);
|
||||
if (runItemId == null) {
|
||||
throw new Error("Stalker product item not found");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user