Skip to content

Commit

Permalink
Merge pull request #28211 from dukenv0307/fix/27804
Browse files Browse the repository at this point in the history
Update pending action when we cancel task
  • Loading branch information
chiragsalian committed Sep 29, 2023
2 parents 5fd69da + 37b4afa commit 1af1eec
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/libs/actions/Task.js
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,15 @@ function cancelTask(taskReportID, taskTitle, originalStateNum, originalStatusNum
},
},
},
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${parentReport.reportID}`,
value: {
[parentReportAction.reportActionID]: {
pendingAction: null,
},
},
},
];

const failureData = [
Expand All @@ -843,6 +852,15 @@ function cancelTask(taskReportID, taskTitle, originalStateNum, originalStatusNum
[optimisticReportActionID]: null,
},
},
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${parentReport.reportID}`,
value: {
[parentReportAction.reportActionID]: {
pendingAction: null,
},
},
},
];

API.write('CancelTask', {cancelledTaskReportActionID: optimisticReportActionID, taskReportID}, {optimisticData, successData, failureData});
Expand Down

0 comments on commit 1af1eec

Please sign in to comment.