Skip to content

Commit

Permalink
#1437 Remove 1 to shareCount
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Jul 16, 2020
1 parent fec2a32 commit dce5882
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ trait CaseRenderer {
caseSteps.origin.name.map(org => JsBoolean(org == authContext.organisation))

def shareCountStats(caseSteps: CaseSteps): Traversal[JsValue, JsValue] =
caseSteps.organisations.count.map(c => JsNumber.apply(c - 1))
caseSteps.organisations.count.map(c => JsNumber(c - 1))

def permissions(caseSteps: CaseSteps)(implicit authContext: AuthContext): Traversal[JsValue, JsValue] =
caseSteps.userPermissions.map(permissions => Json.toJson(permissions))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ trait ObservableRenderer {
observableSteps.shares.organisation.name.fold.map(orgs => Json.toJson(orgs.asScala))

def shareCount(observableSteps: ObservableSteps): Traversal[JsValue, JsValue] =
observableSteps.organisations.count.map(count => JsNumber.apply(count.longValue()))
observableSteps.organisations.count.map(c => JsNumber(c - 1))

def isOwner(
observableSteps: ObservableSteps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ trait TaskRenderer {
taskSteps.caseTemplate.fold.map(_.asScala.headOption.fold[JsValue](JsNull)(ct => JsString(ct.id().toString)))

def shareCount(taskSteps: TaskSteps): Traversal[JsValue, JsValue] =
taskSteps.organisations.count.map(count => JsNumber.apply(count.longValue()))
taskSteps.organisations.count.map(c => JsNumber(c - 1))

def isOwner(taskSteps: TaskSteps)(implicit authContext: AuthContext): Traversal[JsValue, JsValue] =
taskSteps.origin.name.map(orgName => JsBoolean(orgName == authContext.organisation))
Expand Down

0 comments on commit dce5882

Please # to comment.