mirror of
https://github.com/clucraft/PriceGhost.git
synced 2026-07-02 16:01:01 +02:00
Fix product update route to include notification settings
Add price_drop_threshold and notify_back_in_stock to PUT /products/:id Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
09b7e66758
commit
59db0f5bb0
2 changed files with 7 additions and 3 deletions
|
|
@ -129,11 +129,13 @@ router.put('/:id', async (req: AuthRequest, res: Response) => {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const { name, refresh_interval } = req.body;
|
const { name, refresh_interval, price_drop_threshold, notify_back_in_stock } = req.body;
|
||||||
|
|
||||||
const product = await productQueries.update(productId, userId, {
|
const product = await productQueries.update(productId, userId, {
|
||||||
name,
|
name,
|
||||||
refresh_interval,
|
refresh_interval,
|
||||||
|
price_drop_threshold,
|
||||||
|
notify_back_in_stock,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!product) {
|
if (!product) {
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,8 @@ export default function Settings() {
|
||||||
setSettings(response.data);
|
setSettings(response.data);
|
||||||
setTelegramBotToken('');
|
setTelegramBotToken('');
|
||||||
setSuccess('Telegram settings saved successfully');
|
setSuccess('Telegram settings saved successfully');
|
||||||
} catch {
|
} catch (err) {
|
||||||
|
console.error('Telegram save error:', err);
|
||||||
setError('Failed to save Telegram settings');
|
setError('Failed to save Telegram settings');
|
||||||
} finally {
|
} finally {
|
||||||
setIsSaving(false);
|
setIsSaving(false);
|
||||||
|
|
@ -64,7 +65,8 @@ export default function Settings() {
|
||||||
setSettings(response.data);
|
setSettings(response.data);
|
||||||
setDiscordWebhookUrl('');
|
setDiscordWebhookUrl('');
|
||||||
setSuccess('Discord settings saved successfully');
|
setSuccess('Discord settings saved successfully');
|
||||||
} catch {
|
} catch (err) {
|
||||||
|
console.error('Discord save error:', err);
|
||||||
setError('Failed to save Discord settings');
|
setError('Failed to save Discord settings');
|
||||||
} finally {
|
} finally {
|
||||||
setIsSaving(false);
|
setIsSaving(false);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue