Skip to content

Commit

Permalink
Merge pull request #81 from mollie/feature/MOL-439/PICT-253
Browse files Browse the repository at this point in the history
MOL-439/MOL-253: fix wrong data type validation
  • Loading branch information
tdang1-shopmacher authored Oct 15, 2024
2 parents 75dedbd + 51ddfc3 commit 78be405
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ const MethodDetailsForm = (props: TCustomObjectDetailsFormProps) => {
onBlur={formik.handleBlur}
isReadOnly={props.isReadOnly}
horizontalConstraint={13}
isRequired={false}
renderError={(errorKey) => {
if (errorKey === 'invalidLength') {
return intl.formatMessage(messages.fieldMethodNameInvalidLength);
Expand All @@ -91,7 +90,6 @@ const MethodDetailsForm = (props: TCustomObjectDetailsFormProps) => {
onBlur={formik.handleBlur}
isReadOnly={props.isReadOnly}
horizontalConstraint={13}
isRequired={false}
renderError={(errorKey) => {
if (errorKey === 'invalidLength') {
return intl.formatMessage(
Expand Down
5 changes: 1 addition & 4 deletions application/src/components/method-details/method-details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,7 @@ const MethodDetails = (props: TMethodDetailsProps) => {
/>
<CustomFormModalPage.FormPrimaryButton
label={CustomFormModalPage.Intl.save}
onClick={(event) => {
event.preventDefault();
formProps.submitForm();
}}
onClick={() => formProps.submitForm()}
isDisabled={
formProps.isSubmitting || !formProps.isDirty || !canManage
}
Expand Down
2 changes: 1 addition & 1 deletion application/src/components/method-details/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const validate = (
}
if (
!Number.isInteger(formikValues.displayOrder) ||
formikValues.displayOrder <= 0 ||
formikValues.displayOrder < 0 ||
formikValues.displayOrder > 100
) {
errors.displayOrder.isNotInteger = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const convertMollieMethodToCustomMethod = (
}, {} as Record<string, string>),
imageUrl: method.image.svg,
status: 'Inactive',
displayOrder: undefined,
displayOrder: 0,
}));
};

Expand Down

0 comments on commit 78be405

Please sign in to comment.