Skip to content

Commit

Permalink
#1437 Prevent query failure on isOwner extraData
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Jul 16, 2020
1 parent dce5882 commit e0bd0d1
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 @@ -56,7 +56,7 @@ trait CaseRenderer {
def isOwnerStats(
caseSteps: CaseSteps
)(implicit authContext: AuthContext): Traversal[JsValue, JsValue] =
caseSteps.origin.name.map(org => JsBoolean(org == authContext.organisation))
caseSteps.origin.has("name", authContext.organisation).fold.map(l => JsBoolean(!l.isEmpty))

def shareCountStats(caseSteps: CaseSteps): Traversal[JsValue, JsValue] =
caseSteps.organisations.count.map(c => JsNumber(c - 1))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ trait ObservableRenderer {
def isOwner(
observableSteps: ObservableSteps
)(implicit authContext: AuthContext): Traversal[JsValue, JsValue] =
observableSteps.origin.name.map(orgName => JsBoolean(orgName == authContext.organisation))
observableSteps.origin.has("name", authContext.organisation).fold.map(l => JsBoolean(!l.isEmpty))

def observableLinks(observableSteps: ObservableSteps): Traversal[JsValue, JsValue] =
observableSteps.coalesce(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ trait TaskRenderer {
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))
taskSteps.origin.has("name", authContext.organisation).fold.map(l => JsBoolean(!l.isEmpty))

def taskStatsRenderer(extraData: Set[String])(
implicit authContext: AuthContext,
Expand Down

0 comments on commit e0bd0d1

Please # to comment.