Skip to content

Commit

Permalink
Merge simplified report object into Onyx
Browse files Browse the repository at this point in the history
  • Loading branch information
roryabraham committed Mar 29, 2022
1 parent c71d193 commit 8868ad2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/libs/actions/Report.js
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,8 @@ function fetchOrCreateChatReport(participants, shouldNavigate = true) {
}

// Merge report into Onyx
Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${data.reportID}`, {reportID: data.reportID});
const simplifiedReportObject = getSimplifiedReportObject(data);
Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${data.reportID}`, simplifiedReportObject);

if (shouldNavigate) {
// Redirect the logged in person to the new report
Expand All @@ -916,7 +917,7 @@ function fetchOrCreateChatReport(participants, shouldNavigate = true) {

// We are returning an array with a report object here since fetchAllReports calls this method or
// fetchChatReportsByIDs which returns an array of report objects.
return [getSimplifiedReportObject(data)];
return [simplifiedReportObject];
});
}

Expand Down

0 comments on commit 8868ad2

Please sign in to comment.