mirror of
https://github.com/juanfont/headscale.git
synced 2025-08-12 03:57:35 +00:00
Allow to remove forced tags of a node
Set as empty StringList
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user