Skip to content

Commit

Permalink
#1766 Add procedureCount in case extraData
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Mar 17, 2021
1 parent 711c696 commit e404ddb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions thehive/app/org/thp/thehive/controllers/v1/CaseRenderer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ trait CaseRenderer extends BaseRenderer[Case] {
def actionRequired(implicit authContext: AuthContext): Traversal.V[Case] => Traversal[JsValue, Boolean, Converter[JsValue, Boolean]] =
_.isActionRequired.domainMap(JsBoolean(_))

def procedureCount: Traversal.V[Case] => Traversal[JsNumber, JLong, Converter[JsNumber, JLong]] =
_.procedure.count.domainMap(JsNumber(_))

def caseStatsRenderer(extraData: Set[String])(implicit
authContext: AuthContext
): Traversal.V[Case] => JsTraversal = { implicit traversal =>
Expand All @@ -73,6 +76,7 @@ trait CaseRenderer extends BaseRenderer[Case] {
case (f, "shareCount") => addData("shareCount", f)(shareCountStats)
case (f, "permissions") => addData("permissions", f)(permissions)
case (f, "actionRequired") => addData("actionRequired", f)(actionRequired)
case (f, "procedureCount") => addData("procedureCount", f)(procedureCount)
case (f, _) => f
}
)
Expand Down

0 comments on commit e404ddb

Please sign in to comment.