Skip to content

Commit

Permalink
add failure data for report actions and add default value for oldPoli…
Browse files Browse the repository at this point in the history
…cy failure data

Signed-off-by: Tsaqif <[email protected]>
  • Loading branch information
tsa321 committed Oct 9, 2023
1 parent 328e1df commit a88ac00
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/libs/actions/Policy.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ function removeMembers(accountIDs, policyID) {
key: membersListKey,
value: _.object(accountIDs, Array(accountIDs.length).fill({errors: ErrorUtils.getMicroSecondOnyxError('workspace.people.error.genericRemove')})),
},
..._.map(workspaceChats, ({reportID, stateNum, statusNum, hasDraft, oldPolicyName}) => ({
..._.map(workspaceChats, ({reportID, stateNum, statusNum, hasDraft, oldPolicyName = null}) => ({
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`,
value: {
Expand All @@ -250,6 +250,11 @@ function removeMembers(accountIDs, policyID) {
oldPolicyName,
},
})),
..._.map(optimisticClosedReportActions, (reportAction, index) => ({
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${workspaceChats[index].reportID}`,
value: {[reportAction.reportActionID]: null},
})),
];
API.write(
'DeleteMembersFromWorkspace',
Expand Down

0 comments on commit a88ac00

Please sign in to comment.