feat(note_tags): bulk create func

This commit is contained in:
Kristian Borgwarth 2026-04-03 13:22:20 +02:00
parent b132b7e450
commit 4da1ae0322
2 changed files with 8 additions and 1 deletions

View file

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

View file

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