refactor: add tag and relation methods to node to enforce integrity

This commit is contained in:
2026-03-29 23:16:44 +02:00
parent 4ebcb88628
commit dadd3d9e13
15 changed files with 313 additions and 179 deletions

View File

@@ -17,12 +17,13 @@ var delCmd = &cobra.Command{
Run: func(cmd *cobra.Command, args []string) {
svc, err := service.GetNodeService(cfg)
if err != nil {
fmt.Fprintln(os.Stderr, "failed to create service: %v", err)
fmt.Fprintln(os.Stderr, err)
return
}
n, err := svc.GetByID(args[0])
if err != nil {
fmt.Fprintln(os.Stderr, " node not found:", args[0])
fmt.Fprintf(os.Stderr, "node not found: %s", args[0])
return
}
@@ -36,7 +37,7 @@ var delCmd = &cobra.Command{
}
if err := svc.Delete(args[0]); err != nil {
fmt.Fprintln(os.Stderr, "failed to delete: ", err)
fmt.Fprintf(os.Stderr, "failed to delete: %v", err)
} else {
output.PrintAction(cmd.OutOrStdout(), "Deleted", args[0], true)
}