Skip to content

Commit

Permalink
run prettier
Browse files Browse the repository at this point in the history
Signed-off-by: Tsaqif <[email protected]>
  • Loading branch information
tsa321 committed Oct 6, 2023
1 parent 311870d commit 328e1df
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
6 changes: 1 addition & 5 deletions src/libs/ReportUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', '')));
}

/*
Expand Down
14 changes: 7 additions & 7 deletions src/libs/actions/Policy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
{
Expand All @@ -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 = [
Expand Down

0 comments on commit 328e1df

Please sign in to comment.