From 72eeb5cf9bb44ba28437b31827bb27a8e4ff1e08 Mon Sep 17 00:00:00 2001 From: dev Date: Fri, 18 Sep 2026 23:32:55 +0300 Subject: [PATCH] fix(entries): keep AI description and status when editing entry --- server.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/server.js b/server.js index b1aed04..10a140e 100644 --- a/server.js +++ b/server.js @@ -3802,10 +3802,6 @@ app.put('/api/entries/:id', requireAuth, upload.array('photo', 10), async (req, group_id = COALESCE($2, group_id), description = COALESCE($3, description), description_original = COALESCE($3, description_original), - description_ai = CASE WHEN $3 IS NULL THEN description_ai ELSE NULL END, - ai_status = CASE WHEN $3 IS NULL THEN ai_status ELSE 'pending' END, - ai_error = CASE WHEN $3 IS NULL THEN ai_error ELSE NULL END, - ai_checked_at = CASE WHEN $3 IS NULL THEN ai_checked_at ELSE NULL END, module_id = CASE WHEN $5 THEN $6 ELSE module_id END WHERE id = $4 RETURNING *`, [ @@ -3821,7 +3817,6 @@ app.put('/api/entries/:id', requireAuth, upload.array('photo', 10), async (req, newPhotos.forEach(p => safeUnlink(p.path)); return res.status(404).json({ error: 'Not found' }); } - if (description && entryAutoChecker) entryAutoChecker.notify(); const { rows: existingPhotos } = await pool.query('SELECT id, photo_path FROM entry_photos WHERE entry_id = $1 ORDER BY sort_order, id', [req.params.id]); const nextSortOrder = existingPhotos.length;