Skip to content

Commit

Permalink
Merge pull request #28213 from azamuddin/fix/proptypes-warning-policy…
Browse files Browse the repository at this point in the history
…-required-money-request-header

fix: mark propTypes policy as optional and provides default value
  • Loading branch information
puneetlath authored Oct 6, 2023
2 parents eb8783c + 9f73b67 commit 3e4731d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/components/MoneyReportHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const propTypes = {

/** The role of the current user in the policy */
role: PropTypes.string,
}).isRequired,
}),

/** The chat report this report is linked to */
chatReport: reportPropTypes,
Expand All @@ -57,6 +57,7 @@ const defaultProps = {
session: {
email: null,
},
policy: {},
};

function MoneyReportHeader({session, personalDetails, policy, chatReport, report: moneyRequestReport, isSmallScreenWidth}) {
Expand Down
3 changes: 2 additions & 1 deletion src/components/MoneyRequestHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const propTypes = {
policy: PropTypes.shape({
/** Name of the policy */
name: PropTypes.string,
}).isRequired,
}),

/** Personal details so we can get the ones for the report participants */
personalDetails: PropTypes.objectOf(participantPropTypes).isRequired,
Expand Down Expand Up @@ -59,6 +59,7 @@ const defaultProps = {
parentReport: {},
parentReportAction: {},
transaction: {},
policy: {},
};

function MoneyRequestHeader({session, parentReport, report, parentReportAction, transaction, policy, personalDetails}) {
Expand Down

0 comments on commit 3e4731d

Please sign in to comment.