Skip to content

Commit

Permalink
#21 Add success field in report
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed May 7, 2017
1 parent 5653c19 commit 2ba3ff8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions app/models/JsonFormat.scala
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,11 @@ object JsonFormat {
val reportWrites: Writes[Report] = Writes[Report] {
case SuccessReport(artifacts, full, summary) Json.obj(
"artifacts" artifacts,
"full" full,
"summary" summary)
case FailureReport(message) Json.obj("errorMessage" message)
"full" (full + ("success" JsBoolean(true))),
"summary" (summary + ("success" JsBoolean(true))))
case FailureReport(message) Json.obj(
"errorMessage" message,
"success" false)
}

implicit val reportFormat: Format[Report] = Format[Report](reportReads, reportWrites)
Expand Down

0 comments on commit 2ba3ff8

Please sign in to comment.