Skip to content

Commit

Permalink
fix: Better handling of default values for GovPayMetadata (#2925)
Browse files Browse the repository at this point in the history
  • Loading branch information
DafyddLlyr authored Mar 26, 2024
1 parent 3cc37cb commit 99f77af
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api.planx.uk/modules/pay/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export async function buildPaymentPayload(
inviteToPay: true,
};

const metadata = govPayMetadata.length
const metadata = Object.keys(govPayMetadata).length
? govPayMetadata
: defaultGovPayMetadata;

Expand Down
2 changes: 1 addition & 1 deletion editor.planx.uk/src/@planx/components/Pay/Public/Pay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function Component(props: Props) {
{ key: "flow", value: flowSlug },
{ key: "isInviteToPay", value: false },
];
const metadata = props.govPayMetadata.length
const metadata = props.govPayMetadata?.length
? props.govPayMetadata
: defaultMetadata;

Expand Down

0 comments on commit 99f77af

Please sign in to comment.