mirror of
https://github.com/clucraft/PriceGhost.git
synced 2026-04-25 00:36:32 +02:00
Fix AI verification toggle not persisting
The GET and PUT /api/settings/ai endpoints were missing ai_verification_enabled in the request/response handling. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
715765bc58
commit
3d91489f12
1 changed files with 4 additions and 1 deletions
|
|
@ -239,6 +239,7 @@ router.get('/ai', async (req: AuthRequest, res: Response) => {
|
|||
|
||||
res.json({
|
||||
ai_enabled: settings.ai_enabled || false,
|
||||
ai_verification_enabled: settings.ai_verification_enabled || false,
|
||||
ai_provider: settings.ai_provider || null,
|
||||
anthropic_api_key: settings.anthropic_api_key || null,
|
||||
openai_api_key: settings.openai_api_key || null,
|
||||
|
|
@ -255,10 +256,11 @@ router.get('/ai', async (req: AuthRequest, res: Response) => {
|
|||
router.put('/ai', async (req: AuthRequest, res: Response) => {
|
||||
try {
|
||||
const userId = req.userId!;
|
||||
const { ai_enabled, ai_provider, anthropic_api_key, openai_api_key, ollama_base_url, ollama_model } = req.body;
|
||||
const { ai_enabled, ai_verification_enabled, ai_provider, anthropic_api_key, openai_api_key, ollama_base_url, ollama_model } = req.body;
|
||||
|
||||
const settings = await userQueries.updateAISettings(userId, {
|
||||
ai_enabled,
|
||||
ai_verification_enabled,
|
||||
ai_provider,
|
||||
anthropic_api_key,
|
||||
openai_api_key,
|
||||
|
|
@ -273,6 +275,7 @@ router.put('/ai', async (req: AuthRequest, res: Response) => {
|
|||
|
||||
res.json({
|
||||
ai_enabled: settings.ai_enabled || false,
|
||||
ai_verification_enabled: settings.ai_verification_enabled || false,
|
||||
ai_provider: settings.ai_provider || null,
|
||||
anthropic_api_key: settings.anthropic_api_key || null,
|
||||
openai_api_key: settings.openai_api_key || null,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue