This commit is contained in:
m
2026-07-13 11:47:48 +02:00
parent c3bb0dd6ab
commit 0aa3549561
6 changed files with 162 additions and 22 deletions
+2 -2
View File
@@ -122,14 +122,14 @@ func (s *FileService) UpdateOCRText(id, text string) error {
})
}
func (s *FileService) AddTags(fileID string, tagNames []string) error {
func (s *FileService) AddTags(fileID string, tagNames []string, tagType string) error {
for _, name := range tagNames {
tag, err := s.queries.GetTagByName(context.Background(), name)
if err == sql.ErrNoRows {
tag, err = s.queries.CreateTag(context.Background(), db.CreateTagParams{
ID: uuid.New().String(),
TagName: name,
TagType: "none",
TagType: tagType,
})
if err != nil {
return fmt.Errorf("create tag %q: %w", name, err)