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 }