Skip to content

Commit

Permalink
Merge pull request #31861 from Expensify/cmartins-fixUndefinedWorkspa…
Browse files Browse the repository at this point in the history
…ceName

[CP Stag] Pass optimistic workspaceName as param
  • Loading branch information
mountiny authored Nov 27, 2023
2 parents c687387 + 88cb0bd commit 1b981e5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/libs/ReportUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -2748,18 +2748,18 @@ function buildOptimisticApprovedReportAction(amount, currency, expenseReportID)
* @param {String} toPolicyID
* @param {Number} newParentReportID
* @param {Number} movedReportID
* @param {String} policyName
*
* @returns {Object}
*/
function buildOptimisticMovedReportAction(fromPolicyID, toPolicyID, newParentReportID, movedReportID) {
function buildOptimisticMovedReportAction(fromPolicyID, toPolicyID, newParentReportID, movedReportID, policyName) {
const originalMessage = {
fromPolicyID,
toPolicyID,
newParentReportID,
movedReportID,
};

const policyName = getPolicyName(allReports[`${ONYXKEYS.COLLECTION.REPORT}${newParentReportID}`]);
const movedActionMessage = [
{
html: `moved the report to the <a href='${CONST.NEW_EXPENSIFY_URL}r/${newParentReportID}' target='_blank' rel='noreferrer noopener'>${policyName}</a> workspace`,
Expand Down
2 changes: 1 addition & 1 deletion src/libs/actions/Policy.js
Original file line number Diff line number Diff line change
Expand Up @@ -1812,7 +1812,7 @@ function createWorkspaceFromIOUPayment(iouReport) {
});

// Create the MOVED report action and add it to the DM chat which indicates to the user where the report has been moved
const movedReportAction = ReportUtils.buildOptimisticMovedReportAction(oldPersonalPolicyID, policyID, memberData.workspaceChatReportID, iouReportID);
const movedReportAction = ReportUtils.buildOptimisticMovedReportAction(oldPersonalPolicyID, policyID, memberData.workspaceChatReportID, iouReportID, workspaceName);
optimisticData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${oldChatReportID}`,
Expand Down

0 comments on commit 1b981e5

Please sign in to comment.