Skip to content

Commit

Permalink
Merge pull request #19513 from phuchoang23/fix-404-error-in-the-conso…
Browse files Browse the repository at this point in the history
…le-when-create-a-task
  • Loading branch information
thienlnam authored May 26, 2023
2 parents 6f243fe + 05690af commit 21fefdb
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions src/libs/actions/Task.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,13 @@ function createTaskAndNavigate(currentUserEmail, parentReportID, title, descript
{
onyxMethod: Onyx.METHOD.SET,
key: `${ONYXKEYS.COLLECTION.REPORT}${optimisticTaskReport.reportID}`,
value: optimisticTaskReport,
value: {
...optimisticTaskReport,
pendingFields: {
createChat: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD,
},
isOptimisticReport: true,
},
},
{
onyxMethod: Onyx.METHOD.SET,
Expand All @@ -80,7 +86,18 @@ function createTaskAndNavigate(currentUserEmail, parentReportID, title, descript
},
];

const successData = [];
const successData = [
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT}${optimisticTaskReport.reportID}`,
value: {
pendingFields: {
createChat: null,
},
isOptimisticReport: false,
},
},
];

const failureData = [
{
Expand Down

0 comments on commit 21fefdb

Please sign in to comment.