Skip to content

Commit

Permalink
Improve isCaseOwned function
Browse files Browse the repository at this point in the history
  • Loading branch information
cnasikas committed Oct 16, 2020
1 parent bf8c499 commit 7d0fbcc
Showing 1 changed file with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,13 @@ interface CaseAction extends FindActionResult {

const isCaseOwned = (action: CaseAction): boolean => {
if (
![SERVICENOW_ACTION_TYPE_ID, JIRA_ACTION_TYPE_ID, RESILIENT_ACTION_TYPE_ID].includes(
[SERVICENOW_ACTION_TYPE_ID, JIRA_ACTION_TYPE_ID, RESILIENT_ACTION_TYPE_ID].includes(
action.actionTypeId
)
) {
return false;
}

if (action.config?.isCaseOwned === true) {
return true;
}

if (action.config?.incidentConfiguration?.mapping) {
return true;
if (action.config?.isCaseOwned === true || action.config?.incidentConfiguration?.mapping) {
return true;
}
}

return false;
Expand Down

0 comments on commit 7d0fbcc

Please sign in to comment.