mirror of
https://github.com/clucraft/PriceGhost.git
synced 2026-05-12 17:22:39 +02:00
Add per-product pause/resume checking feature
Users can now pause and resume price checking for individual products or in bulk via the Actions menu. Backend: - Added checking_paused column to products table - Scheduler skips products with checking_paused=true - Added POST /products/bulk/pause endpoint for bulk pause/resume Frontend: - Added Pause Checking and Resume Checking to bulk Actions menu - Added filter dropdown (All/Active/Paused) next to sort controls - Paused products show greyed out with pause icon and "Paused" label - Progress bar hidden when paused Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
1f668239bd
commit
26a802e3d0
6 changed files with 176 additions and 6 deletions
|
|
@ -268,4 +268,31 @@ router.delete('/:id', async (req: AuthRequest, res: Response) => {
|
|||
}
|
||||
});
|
||||
|
||||
// Bulk pause/resume checking
|
||||
router.post('/bulk/pause', async (req: AuthRequest, res: Response) => {
|
||||
try {
|
||||
const userId = req.userId!;
|
||||
const { ids, paused } = req.body;
|
||||
|
||||
if (!Array.isArray(ids) || ids.length === 0) {
|
||||
res.status(400).json({ error: 'Product IDs array is required' });
|
||||
return;
|
||||
}
|
||||
|
||||
if (typeof paused !== 'boolean') {
|
||||
res.status(400).json({ error: 'Paused status (boolean) is required' });
|
||||
return;
|
||||
}
|
||||
|
||||
const updated = await productQueries.bulkSetCheckingPaused(ids, userId, paused);
|
||||
res.json({
|
||||
message: `${updated} product(s) ${paused ? 'paused' : 'resumed'}`,
|
||||
updated
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('Error bulk updating pause status:', error);
|
||||
res.status(500).json({ error: 'Failed to update pause status' });
|
||||
}
|
||||
});
|
||||
|
||||
export default router;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue