Skip to content

Commit

Permalink
#1940 Unset case Id in alert when the case is removed
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed May 17, 2021
1 parent 0b3676c commit 7846f8e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion thehive/app/org/thp/thehive/services/CaseSrv.scala
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,12 @@ class CaseSrv @Inject() (
.getOrFail("Share")
.flatMap {
case share if share.owner =>
get(`case`).shares.toSeq.toTry(s => shareSrv.unshareCase(s._id)).map(_ => get(`case`).remove())
get(`case`)
.sideEffect(_.alert.update(_.caseId, EntityId.empty))
.shares
.toSeq
.toTry(s => shareSrv.unshareCase(s._id))
.map(_ => get(`case`).remove())
case _ =>
throw BadRequestError("Your organisation must be owner of the case")
// shareSrv.unshareCase(share._id)
Expand Down

0 comments on commit 7846f8e

Please sign in to comment.