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

View file

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

View file

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