payment method
This commit is contained in:
@@ -39,7 +39,6 @@ const UpdatePaymentMethod: FC = () => {
|
||||
if (paymentMethodData?.data) {
|
||||
const data = paymentMethodData.data as CreateRestaurantPaymentMethodType & { id: string }
|
||||
return {
|
||||
title: data.title || '',
|
||||
method: data.method || '',
|
||||
gateway: data.gateway || '',
|
||||
description: data.description || '',
|
||||
@@ -49,7 +48,6 @@ const UpdatePaymentMethod: FC = () => {
|
||||
}
|
||||
}
|
||||
return {
|
||||
title: '',
|
||||
method: '',
|
||||
gateway: '',
|
||||
description: '',
|
||||
@@ -63,7 +61,6 @@ const UpdatePaymentMethod: FC = () => {
|
||||
initialValues,
|
||||
enableReinitialize: true,
|
||||
validationSchema: Yup.object().shape({
|
||||
title: Yup.string().required('عنوان الزامی است'),
|
||||
method: Yup.string().required('روش پرداخت الزامی است'),
|
||||
gateway: Yup.string().when('method', {
|
||||
is: PaymentMethodEnum.Online,
|
||||
@@ -83,7 +80,6 @@ const UpdatePaymentMethod: FC = () => {
|
||||
if (!id) return
|
||||
|
||||
const submitValues: CreateRestaurantPaymentMethodType = {
|
||||
title: values.title,
|
||||
method: values.method,
|
||||
description: values.description,
|
||||
enabled: values.enabled,
|
||||
@@ -160,15 +156,6 @@ const UpdatePaymentMethod: FC = () => {
|
||||
error_text={formik.touched.method && formik.errors.method ? formik.errors.method : ''}
|
||||
/>
|
||||
</div>
|
||||
<div className='mt-6'>
|
||||
<Input
|
||||
label='عنوان'
|
||||
name='title'
|
||||
value={formik.values.title}
|
||||
onChange={formik.handleChange}
|
||||
error_text={formik.touched.title && formik.errors.title ? formik.errors.title : ''}
|
||||
/>
|
||||
</div>
|
||||
{formik.values.method === PaymentMethodEnum.Online && (
|
||||
<>
|
||||
<div className='mt-6'>
|
||||
|
||||
Reference in New Issue
Block a user