Skip to content

Commit

Permalink
#62 Remove deleted observable when searching related cases
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Dec 13, 2016
1 parent e2cf4ad commit 85eaeb0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion thehive-backend/app/services/CaseSrv.scala
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,14 @@ class CaseSrv @Inject() (

def linkedCases(id: String): Source[(Case, Seq[Artifact]), NotUsed] = {
import org.elastic4play.services.QueryDSL._
findSrv[ArtifactModel, Artifact](artifactModel, parent("case", and(withId(id), "status" ~!= CaseStatus.Deleted, "resolutionStatus" ~!= CaseResolutionStatus.Duplicated)), Some("all"), Nil)
findSrv[ArtifactModel, Artifact](
artifactModel,
and(
parent("case", and(
withId(id),
"status" ~!= CaseStatus.Deleted,
"resolutionStatus" ~!= CaseResolutionStatus.Duplicated)),
"status" ~= "Ok"), Some("all"), Nil)
._1
.flatMapConcat { artifact artifactSrv.findSimilar(artifact, Some("all"), Nil)._1 }
.groupBy(20, _.parentId)
Expand Down

0 comments on commit 85eaeb0

Please sign in to comment.