Fix assignee filter bug in List

This commit is contained in:
2026-03-29 18:58:34 +02:00
parent 9e8c37564f
commit 13b4c4b651
22 changed files with 939 additions and 555 deletions

View File

@@ -3,6 +3,7 @@ package cmd
import (
"axolotl/db"
"axolotl/output"
"axolotl/service"
"fmt"
"os"
"os/exec"
@@ -18,7 +19,8 @@ var editCmd = &cobra.Command{
fmt.Fprintln(os.Stderr, err)
return
}
n, err := d.NodeByID(args[0])
svc := service.NewSQLiteNodeService(d.DB, cfg.GetUser())
n, err := svc.GetByID(args[0])
if err != nil {
fmt.Fprintln(os.Stderr, "node not found:", args[0])
return
@@ -45,12 +47,12 @@ var editCmd = &cobra.Command{
}
if content, err := os.ReadFile(tmp.Name()); err == nil {
c := string(content)
if err := d.UpdateNode(args[0], db.UpdateParams{Content: &c}); err != nil {
n.Content = string(content)
if err := svc.Update(n); err != nil {
fmt.Fprintln(os.Stderr, "failed to update:", err)
return
}
n, _ = d.NodeByID(args[0])
n, _ = svc.GetByID(args[0])
output.PrintNode(cmd.OutOrStdout(), n, jsonFlag)
} else {
fmt.Fprintln(os.Stderr, "failed to read temp file:", err)