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: Correctly set parent flow name in GovPayMetadata #3826

Merged
merged 1 commit into from
Oct 18, 2024
Merged
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
6 changes: 3 additions & 3 deletions editor.planx.uk/src/@planx/components/Pay/Public/Pay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ function Component(props: Props) {
state.flowSlug,
]);
const fee = props.fn ? Number(passport.data?.[props.fn]) : 0;

const defaultMetadata = [
{ key: "source", value: "PlanX" },
{ key: "flow", value: flowSlug },
{ key: "paidViaInviteToPay", value: "@paidViaInviteToPay" },
];
const metadata = props.govPayMetadata?.length
? props.govPayMetadata
: defaultMetadata;

const metadata = [...(props.govPayMetadata || []), ...defaultMetadata];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before - defaults were only applied if nothing was set in the Editor.

Now - defaults overwrite any value set in the Editor, and are always correct and up to date.


// Handles UI states
const reducer = (_state: ComponentState, action: Action): ComponentState => {
Expand Down
Loading