Allow to remove forced tags of a node

Set as empty StringList
This commit is contained in:
Juan Font committed 2024-04-18 09:55:55 +02:00
1 parent 580f96ce83
commit c906aaf927
2 files changed
+12

No files matched your search

+5
View File
@@ -206,6 +206,11 @@ func SetTags(
tags []string,
) error {
if len(tags) == 0 {
// if no tags are provided, we remove all forced tags
if err := tx.Model(&types.Node{}).Where("id = ?", nodeID).Update("forced_tags", types.StringList{}).Error; err != nil {
return fmt.Errorf("failed to remove tags for node in the database: %w", err)
}
return nil
}