From cf28be0f15c317880734f08c4c020998981cf83e Mon Sep 17 00:00:00 2001 From: someone-here Date: Thu, 21 Sep 2023 15:41:19 +0530 Subject: [PATCH] Changed default values of policyID --- src/libs/ReportUtils.js | 5 ++--- src/libs/actions/Task.js | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js index d25f77b4b3eb..c27f5f0c4b41 100644 --- a/src/libs/ReportUtils.js +++ b/src/libs/ReportUtils.js @@ -2646,12 +2646,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, @@ -2664,7 +2664,6 @@ function buildOptimisticTaskReport(ownerAccountID, assigneeAccountID = 0, parent 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 4e71a8793f1e..fa6cdcc77706 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;