Skip to content

Commit

Permalink
Merge pull request #135 from City-of-Helsinki/fix/LINK-1897
Browse files Browse the repository at this point in the history
LINK-1897 | remove create_payment from payload
  • Loading branch information
jorilindell committed Feb 7, 2024
2 parents b553a8c + 898353b commit 0586281
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 18 deletions.
1 change: 0 additions & 1 deletion src/domain/signupGroup/__tests__/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ describe('getSignupGroupPayload function', () => {
phone_number: null,
service_language: null,
},
create_payment: false,
extra_info: '',
registration: registration.id,
reservation_code: 'code',
Expand Down
34 changes: 18 additions & 16 deletions src/domain/signupGroup/signupGroupForm/signups/signup/Signup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,22 +113,24 @@ const Signup: React.FC<SignupProps> = ({
toggleButtonLabel={accordionLabel}
>
<Fieldset heading={t(`signup.titleBasicInfo`)}>
{featureFlagUtils.isFeatureEnabled('WEB_STORE_INTEGRATION') &&
priceGroupOptions && (
<FormGroup>
<div className={getRowClassName(styles.nameRow)}>
<Field
name={getFieldName(signupPath, SIGNUP_FIELDS.PRICE_GROUP)}
component={SingleSelectField}
disabled={formDisabled || isEditingMode}
label={t('signup.labelPriceGroup')}
options={priceGroupOptions}
placeholder={t('signup.placeholderPriceGroup')}
required={!!priceGroupOptions?.length}
/>
</div>
</FormGroup>
)}
{Boolean(
featureFlagUtils.isFeatureEnabled('WEB_STORE_INTEGRATION') &&
priceGroupOptions.length
) && (
<FormGroup>
<div className={getRowClassName(styles.nameRow)}>
<Field
name={getFieldName(signupPath, SIGNUP_FIELDS.PRICE_GROUP)}
component={SingleSelectField}
disabled={formDisabled || isEditingMode}
label={t('signup.labelPriceGroup')}
options={priceGroupOptions}
placeholder={t('signup.placeholderPriceGroup')}
required={!!priceGroupOptions?.length}
/>
</div>
</FormGroup>
)}

{(isSignupFieldRequired(registration, SIGNUP_FIELDS.FIRST_NAME) ||
isSignupFieldRequired(registration, SIGNUP_FIELDS.LAST_NAME)) && (
Expand Down
5 changes: 4 additions & 1 deletion src/domain/signupGroup/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,10 @@ export const getSignupGroupPayload = ({

return {
contact_person: getContactPersonPayload(contactPerson),
create_payment: createPayment,
...(featureFlagUtils.isFeatureEnabled('WEB_STORE_INTEGRATION') &&
createPayment
? { create_payment: createPayment }
: {}),
extra_info: groupExtraInfo,
registration: registration.id,
reservation_code: reservationCode,
Expand Down

0 comments on commit 0586281

Please sign in to comment.