Skip to content

Commit

Permalink
#1404 Force using ids to get entities
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Jul 21, 2020
1 parent 0314a95 commit 72b9ca4
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion thehive/app/org/thp/thehive/services/CaseTemplateSrv.scala
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ class CaseTemplateIntegrityCheckOps @Inject() (
override def resolve(entities: List[CaseTemplate with Entity])(implicit graph: Graph): Try[Unit] = entities match {
case head :: tail =>
tail.foreach(copyEdge(_, head, e => e.label() == "CaseCaseTemplate" || e.label() == "AlertCaseTemplate"))
tail.foreach(service.get(_).remove())
service.getByIds(tail.map(_._id): _*).remove()
Success(())
case _ => Success(())
}
Expand Down
2 changes: 1 addition & 1 deletion thehive/app/org/thp/thehive/services/CustomFieldSrv.scala
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class CustomFieldIntegrityCheckOps @Inject() (@Named("with-thehive-schema") val
override def resolve(entities: List[CustomField with Entity])(implicit graph: Graph): Try[Unit] = entities match {
case head :: tail =>
tail.foreach(copyEdge(_, head))
tail.foreach(service.get(_).remove())
service.getByIds(tail.map(_._id): _*).remove()
Success(())
case _ => Success(())
}
Expand Down
2 changes: 1 addition & 1 deletion thehive/app/org/thp/thehive/services/DataSrv.scala
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class DataIntegrityCheckOps @Inject() (@Named("with-thehive-schema") val db: Dat
override def resolve(entities: List[Data with Entity])(implicit graph: Graph): Try[Unit] = entities match {
case head :: tail =>
tail.foreach(copyEdge(_, head))
tail.foreach(service.get(_).remove())
service.getByIds(tail.map(_._id): _*).remove()
Success(())
case _ => Success(())
}
Expand Down
2 changes: 1 addition & 1 deletion thehive/app/org/thp/thehive/services/ImpactStatusSrv.scala
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class ImpactStatusIntegrityCheckOps @Inject() (@Named("with-thehive-schema") val
override def resolve(entities: List[ImpactStatus with Entity])(implicit graph: Graph): Try[Unit] = entities match {
case head :: tail =>
tail.foreach(copyEdge(_, head))
tail.foreach(service.get(_).remove())
service.getByIds(tail.map(_._id): _*).remove()
Success(())
case _ => Success(())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class ObservableTypeIntegrityCheckOps @Inject() (@Named("with-thehive-schema") v
override def resolve(entities: List[ObservableType with Entity])(implicit graph: Graph): Try[Unit] = entities match {
case head :: tail =>
tail.foreach(copyEdge(_, head))
tail.foreach(service.get(_).remove())
service.getByIds(tail.map(_._id): _*).remove()
Success(())
case _ => Success(())
}
Expand Down
2 changes: 1 addition & 1 deletion thehive/app/org/thp/thehive/services/OrganisationSrv.scala
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ class OrganisationIntegrityCheckOps @Inject() (@Named("with-thehive-schema") val
override def resolve(entities: List[Organisation with Entity])(implicit graph: Graph): Try[Unit] = entities match {
case head :: tail =>
tail.foreach(copyEdge(_, head))
tail.foreach(service.get(_).remove())
service.getByIds(tail.map(_._id): _*).remove()
Success(())
case _ => Success(())
}
Expand Down
2 changes: 1 addition & 1 deletion thehive/app/org/thp/thehive/services/ProfileSrv.scala
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class ProfileIntegrityCheckOps @Inject() (@Named("with-thehive-schema") val db:
override def resolve(entities: List[Profile with Entity])(implicit graph: Graph): Try[Unit] = entities match {
case head :: tail =>
tail.foreach(copyEdge(_, head))
tail.foreach(service.get(_).remove())
service.getByIds(tail.map(_._id): _*).remove()
Success(())
case _ => Success(())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class ResolutionStatusIntegrityCheckOps @Inject() (@Named("with-thehive-schema")
override def resolve(entities: List[ResolutionStatus with Entity])(implicit graph: Graph): Try[Unit] = entities match {
case head :: tail =>
tail.foreach(copyEdge(_, head))
tail.foreach(service.get(_).remove())
service.getByIds(tail.map(_._id): _*).remove()
Success(())
case _ => Success(())
}
Expand Down

0 comments on commit 72b9ca4

Please sign in to comment.