debug: logging on tag creates

This commit is contained in:
Kristian Borgwarth 2026-04-05 12:42:26 +02:00
parent 2081882b41
commit 2b92897803
3 changed files with 10 additions and 5 deletions

View file

@ -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) {

View file

@ -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
}

BIN
dendrite

Binary file not shown.