feat: added endpoint to update list item title only

This commit is contained in:
2026-09-04 10:11:32 +02:00
parent ad8a5e3bab
commit 4cb03c6712
5 changed files with 86 additions and 4 deletions
+11
View File
@@ -150,6 +150,17 @@ func (r *ListRepo) UpdateListItem(ctx context.Context, listItemID string, title
return nil
}
func (r *ListRepo) SetListItemTitle(ctx context.Context, listItemID string, title string) error {
_, err := r.conn(ctx).ExecContext(ctx, "UPDATE list_items SET title = $1, modified_at = NOW() WHERE id = $2",
title, listItemID,
)
if err != nil {
return fmt.Errorf("failed to update list item title: %w", err)
}
return nil
}
func (r *ListRepo) SetListItemCompleted(ctx context.Context, listItemID string, isCompleted bool) error {
_, err := r.conn(ctx).ExecContext(ctx, "UPDATE list_items SET is_completed = $1, modified_at = NOW() WHERE id = $2",
isCompleted, listItemID,