Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: mark propTypes policy as optional and provides default value #28213

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -29,7 +29,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 @@ -58,6 +58,7 @@ const defaultProps = {
parentReport: {},
parentReportAction: {},
transaction: {},
policy: {},
};

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