diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js index 113aac066515..eda70845a9f2 100644 --- a/src/libs/ReportUtils.js +++ b/src/libs/ReportUtils.js @@ -3545,11 +3545,7 @@ function getPolicyExpenseChatReportIDByOwner(policyOwner) { * @returns {Array} */ function getWorkspaceChats(policyID, accountIDs) { - return _.filter(allReports, (report) => - isPolicyExpenseChat(report) && - lodashGet(report, 'policyID', '') === policyID && - _.contains(accountIDs, lodashGet(report, 'ownerAccountID', '')) - ) + return _.filter(allReports, (report) => isPolicyExpenseChat(report) && lodashGet(report, 'policyID', '') === policyID && _.contains(accountIDs, lodashGet(report, 'ownerAccountID', ''))); } /* diff --git a/src/libs/actions/Policy.js b/src/libs/actions/Policy.js index b6fd208a2052..8fd0ff73d334 100644 --- a/src/libs/actions/Policy.js +++ b/src/libs/actions/Policy.js @@ -201,7 +201,8 @@ function removeMembers(accountIDs, policyID) { const policy = ReportUtils.getPolicy(policyID); const workspaceChats = ReportUtils.getWorkspaceChats(policyID, accountIDs); const optimisticClosedReportActions = _.map(workspaceChats, () => - ReportUtils.buildOptimisticClosedReportAction(sessionEmail, policy.name, CONST.REPORT.ARCHIVE_REASON.REMOVED_FROM_POLICY)); + ReportUtils.buildOptimisticClosedReportAction(sessionEmail, policy.name, CONST.REPORT.ARCHIVE_REASON.REMOVED_FROM_POLICY), + ); const optimisticData = [ { @@ -217,14 +218,13 @@ function removeMembers(accountIDs, policyID) { stateNum: CONST.REPORT.STATE_NUM.SUBMITTED, oldPolicyName: policy.name, hasDraft: false, - } + }, })), ..._.map(optimisticClosedReportActions, (reportAction, index) => ({ - onyxMethod: Onyx.METHOD.MERGE, - key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${workspaceChats[index].reportID}`, - value: {[reportAction.reportActionID]: reportAction}, - } - )), + onyxMethod: Onyx.METHOD.MERGE, + key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${workspaceChats[index].reportID}`, + value: {[reportAction.reportActionID]: reportAction}, + })), ]; const successData = [