Skip to content

Commit

Permalink
#1865 Add organisation (ID and name) in webhook message
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Mar 23, 2021
1 parent 61057cc commit 618fb08
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,11 @@ class Webhook(
else {
val ws = new ProxyWS(config.wsConfig, mat)
val async = for {
message <- Future.fromTry(buildMessage(config.version, audit))
message <- Future.fromTry(
buildMessage(config.version, audit).map(
_ + ("organisationId" -> JsString(organisation._id.toString)) + ("organisation" -> JsString(organisation.name))
)
)
_ = logger.debug(s"Request webhook with message $message")
resp <- config.auth(ws.url(config.url)).post(message)
} yield if (resp.status >= 400) logger.warn(s"Webhook call on ${config.url} returns ${resp.status} ${resp.statusText}") else ()
Expand Down

0 comments on commit 618fb08

Please sign in to comment.