Merge pull request #124 from R0m1k3/claude/fix-notes-sync-issue-01AMeEdrKQErsM7bvhKkqEEF

fix: correct SQL bug in todo creation query
This commit is contained in:
LogiFlow authored and GitHub committed 2025-11-27 13:52:29 +01:00
commit acd80ce4f0
1 file changed
+1 -1
+1 -1
View File
@@ -414,7 +414,7 @@ router.post('/:id/todos',
const result = await runQuery(` const result = await runQuery(`
INSERT INTO note_todos (note_id, text, position) INSERT INTO note_todos (note_id, text, position)
VALUES ($1, $2, (SELECT COALESCE(MAX(position), FALSE) + 1 FROM note_todos WHERE note_id = $3)) VALUES ($1, $2, (SELECT COALESCE(MAX(position), 0) + 1 FROM note_todos WHERE note_id = $3))
RETURNING * RETURNING *
`, [req.params.id, text, req.params.id]); `, [req.params.id, text, req.params.id]);