Fix updateLastChecked calls to include refresh_interval

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
clucraft 2026-01-20 21:44:28 -05:00
parent 4acd5c1432
commit fde620357a
3 changed files with 2923 additions and 4 deletions

2919
backend/package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -78,8 +78,8 @@ router.post('/:productId/refresh', async (req: AuthRequest, res: Response) => {
); );
} }
// Update last_checked timestamp // Update last_checked timestamp and schedule next check
await productQueries.updateLastChecked(productId); await productQueries.updateLastChecked(productId, product.refresh_interval);
res.json({ res.json({
message: scrapedData.stockStatus === 'out_of_stock' message: scrapedData.stockStatus === 'out_of_stock'

View file

@ -69,8 +69,8 @@ router.post('/', async (req: AuthRequest, res: Response) => {
); );
} }
// Update last_checked timestamp // Update last_checked timestamp and schedule next check
await productQueries.updateLastChecked(product.id); await productQueries.updateLastChecked(product.id, product.refresh_interval);
// Fetch the product with the price // Fetch the product with the price
const productWithPrice = await productQueries.findById(product.id, userId); const productWithPrice = await productQueries.findById(product.id, userId);