From 4da1ae032278043fc4e5180f3569666ba3d7d065 Mon Sep 17 00:00:00 2001 From: Kristian Borgwarth <10348902@pm.me> Date: Fri, 3 Apr 2026 13:22:20 +0200 Subject: [PATCH] feat(note_tags): bulk create func --- core/handlers/create_note_handler.go | 1 - core/models/note_tag.go | 8 ++++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/core/handlers/create_note_handler.go b/core/handlers/create_note_handler.go index b7fffea..139731a 100644 --- a/core/handlers/create_note_handler.go +++ b/core/handlers/create_note_handler.go @@ -8,7 +8,6 @@ import ( "github.com/KristianJBorgwarth/dendrite.daemon/core/models" "github.com/KristianJBorgwarth/dendrite.daemon/core/template" "github.com/KristianJBorgwarth/dendrite.daemon/persistence/repositories" - "github.com/google/uuid" ) type createNoteCommand struct { diff --git a/core/models/note_tag.go b/core/models/note_tag.go index 3b6dd36..c7e6090 100644 --- a/core/models/note_tag.go +++ b/core/models/note_tag.go @@ -12,6 +12,14 @@ func NewNoteTag(noteID, tagID string) *NoteTag { } } +func NewNoteTags(noteID string, tagIDs []string) []*NoteTag { + noteTags := make([]*NoteTag, len(tagIDs)) + for i, tagID := range tagIDs { + noteTags[i] = NewNoteTag(noteID, tagID) + } + return noteTags +} + func (nt *NoteTag) NoteID() string { return nt.noteID }