fix: properties like type were not correctly replaced when updating a node
This commit is contained in:
@@ -65,9 +65,17 @@ var updateCmd = &cobra.Command{
|
||||
} else if slices.Contains(uAddTags, "_status::open") {
|
||||
uRmTags = append(uRmTags, "_status::done")
|
||||
}
|
||||
if slices.ContainsFunc(uAddTags, func(e string) bool { return strings.HasPrefix(e, "_prio") }) {
|
||||
uRmTags = append(uRmTags, "_prio::low", "_prio::medium", "_prio::high")
|
||||
|
||||
for _, prefix := range []string{"_type::", "_status::", "_prio::", "_namespace::"} {
|
||||
if slices.ContainsFunc(uAddTags, func(e string) bool { return strings.HasPrefix(e, prefix) }) {
|
||||
for _, existing := range node.Tags {
|
||||
if strings.HasPrefix(existing, prefix) {
|
||||
uRmTags = append(uRmTags, existing)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if cmd.Flags().Changed("title") {
|
||||
node.Title = uTitle
|
||||
|
||||
Reference in New Issue
Block a user