diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js index f168cc66ce98..9b42a0925680 100644 --- a/src/libs/ReportUtils.js +++ b/src/libs/ReportUtils.js @@ -2678,12 +2678,12 @@ function buildOptimisticWorkspaceChats(policyID, policyName) { * @param {String} parentReportID - Report ID of the chat where the Task is. * @param {String} title - Task title. * @param {String} description - Task description. - * @param {String | undefined} policyID - PolicyID of the parent report + * @param {String} policyID - PolicyID of the parent report * * @returns {Object} */ -function buildOptimisticTaskReport(ownerAccountID, assigneeAccountID = 0, parentReportID, title, description, policyID = undefined) { +function buildOptimisticTaskReport(ownerAccountID, assigneeAccountID = 0, parentReportID, title, description, policyID = CONST.POLICY.OWNER_EMAIL_FAKE) { return { reportID: generateReportID(), reportName: title, @@ -2693,9 +2693,9 @@ function buildOptimisticTaskReport(ownerAccountID, assigneeAccountID = 0, parent managerID: assigneeAccountID, type: CONST.REPORT.TYPE.TASK, parentReportID, + policyID, stateNum: CONST.REPORT.STATE_NUM.OPEN, statusNum: CONST.REPORT.STATUS.OPEN, - ...(_.isUndefined(policyID) ? {} : {policyID}), }; } diff --git a/src/libs/actions/Task.js b/src/libs/actions/Task.js index 7c5da062d847..963bfebb7eb2 100644 --- a/src/libs/actions/Task.js +++ b/src/libs/actions/Task.js @@ -59,9 +59,9 @@ function clearOutTaskInfo() { * @param {String} assigneeEmail * @param {Number} assigneeAccountID * @param {Object} assigneeChatReport - The chat report between you and the assignee - * @param {String | undefined} policyID - the policyID of the parent report + * @param {String} policyID - the policyID of the parent report */ -function createTaskAndNavigate(parentReportID, title, description, assigneeEmail, assigneeAccountID = 0, assigneeChatReport = null, policyID = undefined) { +function createTaskAndNavigate(parentReportID, title, description, assigneeEmail, assigneeAccountID = 0, assigneeChatReport = null, policyID = CONST.POLICY.OWNER_EMAIL_FAKE) { const optimisticTaskReport = ReportUtils.buildOptimisticTaskReport(currentUserAccountID, assigneeAccountID, parentReportID, title, description, policyID); const assigneeChatReportID = assigneeChatReport ? assigneeChatReport.reportID : 0;