Skip to content

Commit

Permalink
#1974 Fix tags field update
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Apr 15, 2021
1 parent 5b0e05b commit 293771f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion thehive/app/org/thp/thehive/services/ObservableSrv.scala
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,11 @@ class ObservableSrv @Inject() (
.toSeq
.map(_.toString)
.toSet
val newTags = tags -- currentTags
for {
createdTags <- (tags -- currentTags).filterNot(_.isEmpty).toTry(tagSrv.getOrCreate)
createdTags <- newTags.filterNot(_.isEmpty).toTry(tagSrv.getOrCreate)
_ <- createdTags.toTry(observableTagSrv.create(ObservableTag(), observable, _))
_ <- get(observable).update(_.tags, (currentTags ++ newTags).toSeq).getOrFail("Observable")
// _ <- auditSrv.observable.update(observable, Json.obj("tags" -> (currentTags ++ tags)))
} yield createdTags
}
Expand Down

0 comments on commit 293771f

Please sign in to comment.