Skip to content

Commit

Permalink
pass optimistic workspaceName as param
Browse files Browse the repository at this point in the history
  • Loading branch information
luacmartins committed Nov 24, 2023
1 parent a7ce375 commit 88cb0bd
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 88cb0bd

Please sign in to comment.