mirror of
https://github.com/R0m1k3/noteflow.git
synced 2026-10-11 17:29:37 +02:00
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:
1 file changed
+1
-1
@@ -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]);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user