diff --git a/core/frontmatter/parser.go b/core/frontmatter/parser.go index fe32e6b..ea834c9 100644 --- a/core/frontmatter/parser.go +++ b/core/frontmatter/parser.go @@ -7,11 +7,11 @@ import ( ) type FrontMatter struct { - Title string `yaml:"Title"` - Tags []string `yaml:"Tags"` - Created string `yaml:"Created"` - Updated string `yaml:"Updated"` - Author string `yaml:"Author"` + Title string `yaml:"title"` + Tags []string `yaml:"tags"` + Created string `yaml:"created"` + Updated string `yaml:"updated"` + Author string `yaml:"author"` } func ParseTags(file []byte) ([]string, error) { diff --git a/core/handlers/create_note_handler.go b/core/handlers/create_note_handler.go index 23f0f01..66abaab 100644 --- a/core/handlers/create_note_handler.go +++ b/core/handlers/create_note_handler.go @@ -3,6 +3,7 @@ package handlers import ( "context" "encoding/json" + "log/slog" "github.com/KristianJBorgwarth/dendrite.daemon/core/frontmatter" "github.com/KristianJBorgwarth/dendrite.daemon/core/models" @@ -44,6 +45,8 @@ func (h *CreateNoteHandler) Handle(ctx context.Context, raw json.RawMessage) (an return nil, err } + slog.Debug("parsed tags", "tags", tags) + tx, err := h.uow.Begin() if err != nil { return nil, err @@ -59,6 +62,8 @@ func (h *CreateNoteHandler) Handle(ctx context.Context, raw json.RawMessage) (an return nil, err } + slog.Debug("Creating tags", "tags", tags) + if err = tagRepo.Upsert(ctx, tagModels); err != nil { return nil, err } diff --git a/dendrite b/dendrite index 67be805..2eff99a 100755 Binary files a/dendrite and b/dendrite differ