feat(note_tags): bulk create func
This commit is contained in:
parent
b132b7e450
commit
4da1ae0322
2 changed files with 8 additions and 1 deletions
|
|
@ -8,7 +8,6 @@ import (
|
||||||
"github.com/KristianJBorgwarth/dendrite.daemon/core/models"
|
"github.com/KristianJBorgwarth/dendrite.daemon/core/models"
|
||||||
"github.com/KristianJBorgwarth/dendrite.daemon/core/template"
|
"github.com/KristianJBorgwarth/dendrite.daemon/core/template"
|
||||||
"github.com/KristianJBorgwarth/dendrite.daemon/persistence/repositories"
|
"github.com/KristianJBorgwarth/dendrite.daemon/persistence/repositories"
|
||||||
"github.com/google/uuid"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type createNoteCommand struct {
|
type createNoteCommand struct {
|
||||||
|
|
|
||||||
|
|
@ -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 {
|
func (nt *NoteTag) NoteID() string {
|
||||||
return nt.noteID
|
return nt.noteID
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue