mirror of
https://github.com/clucraft/PriceGhost.git
synced 2026-07-02 16:01:01 +02:00
Fix updateLastChecked calls to include refresh_interval
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
4acd5c1432
commit
fde620357a
3 changed files with 2923 additions and 4 deletions
2919
backend/package-lock.json
generated
Normal file
2919
backend/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -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'
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue