From 699293068349b10f5dc333e4762d340e8b587cca Mon Sep 17 00:00:00 2001 From: Dylan Date: Sat, 9 Dec 2023 16:27:03 +0700 Subject: [PATCH] update name --- src/components/ReportActionItem/TaskPreview.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/ReportActionItem/TaskPreview.js b/src/components/ReportActionItem/TaskPreview.js index 1eb8b5d2ea0d..b9e546943440 100644 --- a/src/components/ReportActionItem/TaskPreview.js +++ b/src/components/ReportActionItem/TaskPreview.js @@ -55,7 +55,7 @@ const propTypes = { }), /** The policy of root parent report */ - policy: PropTypes.shape({ + rootParentReportpolicy: PropTypes.shape({ /** The role of current user */ role: PropTypes.string, }), @@ -78,7 +78,7 @@ const propTypes = { const defaultProps = { ...withCurrentUserPersonalDetailsDefaultProps, taskReport: {}, - policy: {}, + rootParentReportpolicy: {}, isHovered: false, }; @@ -123,7 +123,7 @@ function TaskPreview(props) { style={[styles.mr2]} containerStyle={[styles.taskCheckbox]} isChecked={isTaskCompleted} - disabled={!Task.canModifyTask(props.taskReport, props.currentUserPersonalDetails.accountID, lodashGet(props.policy, 'role', ''))} + disabled={!Task.canModifyTask(props.taskReport, props.currentUserPersonalDetails.accountID, lodashGet(props.rootParentReportpolicy, 'role', ''))} onPress={Session.checkIfActionIsAllowed(() => { if (isTaskCompleted) { Task.reopenTask(props.taskReport); @@ -156,7 +156,7 @@ export default compose( key: ({taskReportID}) => `${ONYXKEYS.COLLECTION.REPORT}${taskReportID}`, initialValue: {}, }, - policy: { + rootParentReportpolicy: { key: ({policyID}) => `${ONYXKEYS.COLLECTION.POLICY}${policyID || '0'}`, selector: (policy) => _.pick(policy, ['role']), },