From f5f02041477abf4c7fc0662fbf6b9a90c49123a7 Mon Sep 17 00:00:00 2001 From: Kristian Borgwarth <10348902@pm.me> Date: Sat, 11 Apr 2026 00:04:19 +0200 Subject: [PATCH] ref(command_names): gave commands proper names --- cmd/main.go | 5 +++-- core/handlers/note/save_note.go | 3 ++- persistence/repositories/note_repository.go | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cmd/main.go b/cmd/main.go index da40257..3226c87 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -16,8 +16,9 @@ func main() { logging.Init() server := server.NewServer() - server.RegisterHandler("initialize", vault.NewInitializeHandler()) - server.RegisterHandler("create_note", note.NewCreateNoteHandler()) + server.RegisterHandler("vault/init", vault.NewInitializeHandler()) + server.RegisterHandler("note/create", note.NewCreateNoteHandler()) + server.RegisterHandler("note/save", note.NewSaveNoteHandler()) server.RegisterHandler("completion/link", completion.NewCompleteLinkHandler()) if err := server.Run(os.Stdin, os.Stdout); err != nil { diff --git a/core/handlers/note/save_note.go b/core/handlers/note/save_note.go index 78c4b96..c6701d5 100644 --- a/core/handlers/note/save_note.go +++ b/core/handlers/note/save_note.go @@ -38,7 +38,6 @@ func (h *SaveNoteHandler) Handle(ctx context.Context, raw json.RawMessage) (any, } defer h.uow.Rollback() - tagRepo := repositories.NewTagRepository(tx) noteRepo := repositories.NewNoteRepository(tx) @@ -47,6 +46,8 @@ func (h *SaveNoteHandler) Handle(ctx context.Context, raw json.RawMessage) (any, return nil, err } + println("Saving note:", note.Title(), "at path:", note.Path()) + return nil, nil diff --git a/persistence/repositories/note_repository.go b/persistence/repositories/note_repository.go index 140d6be..d471dc3 100644 --- a/persistence/repositories/note_repository.go +++ b/persistence/repositories/note_repository.go @@ -9,6 +9,7 @@ import ( type NoteRepository interface { Insert(ctx context.Context, note *models.Note) error + GetBySlug(ctx context.Context, slug string) (*models.Note, error) } type noteRepository struct {