From 694eda70af67a7ae1dfdd5f6ac14d4cae9d564bb Mon Sep 17 00:00:00 2001 From: hamid zarghami Date: Wed, 17 Dec 2025 10:04:04 +0330 Subject: [PATCH] payment method --- src/pages/paymentMethods/Create.tsx | 12 ------------ src/pages/paymentMethods/Update.tsx | 13 ------------- .../components/PaymentMethodTableColumns.tsx | 13 +++---------- src/pages/paymentMethods/types/Types.ts | 2 -- 4 files changed, 3 insertions(+), 37 deletions(-) diff --git a/src/pages/paymentMethods/Create.tsx b/src/pages/paymentMethods/Create.tsx index cf6e3be..1986450 100644 --- a/src/pages/paymentMethods/Create.tsx +++ b/src/pages/paymentMethods/Create.tsx @@ -35,7 +35,6 @@ const CreatePaymentMethod: FC = () => { const formik = useFormik({ initialValues: { - title: '', method: '', gateway: '', description: '', @@ -44,7 +43,6 @@ const CreatePaymentMethod: FC = () => { merchantId: '', }, validationSchema: Yup.object().shape({ - title: Yup.string().required('عنوان الزامی است'), method: Yup.string().required('روش پرداخت الزامی است'), gateway: Yup.string().when('method', { is: PaymentMethodEnum.Online, @@ -62,7 +60,6 @@ const CreatePaymentMethod: FC = () => { }), onSubmit: (values) => { const submitValues: CreateRestaurantPaymentMethodType = { - title: values.title, method: values.method, description: values.description, enabled: values.enabled, @@ -120,15 +117,6 @@ const CreatePaymentMethod: FC = () => { error_text={formik.touched.method && formik.errors.method ? formik.errors.method : ''} /> -
- -
{formik.values.method === PaymentMethodEnum.Online && ( <>
diff --git a/src/pages/paymentMethods/Update.tsx b/src/pages/paymentMethods/Update.tsx index fa2302a..4da6113 100644 --- a/src/pages/paymentMethods/Update.tsx +++ b/src/pages/paymentMethods/Update.tsx @@ -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 : ''} />
-
- -
{formik.values.method === PaymentMethodEnum.Online && ( <>
diff --git a/src/pages/paymentMethods/components/PaymentMethodTableColumns.tsx b/src/pages/paymentMethods/components/PaymentMethodTableColumns.tsx index 002bb0e..5ab5d5c 100644 --- a/src/pages/paymentMethods/components/PaymentMethodTableColumns.tsx +++ b/src/pages/paymentMethods/components/PaymentMethodTableColumns.tsx @@ -13,13 +13,6 @@ interface GetPaymentMethodTableColumnsParams { export const getPaymentMethodTableColumns = ({ onDelete, isDeleting }: GetPaymentMethodTableColumnsParams = {}): ColumnType[] => { return [ - { - key: 'title', - title: 'عنوان', - render: (item: RestaurantPaymentMethod) => { - return item.title || '-' - } - }, { key: 'method', title: 'روش', @@ -46,9 +39,9 @@ export const getPaymentMethodTableColumns = ({ onDelete, isDeleting }: GetPaymen title: 'وضعیت', render: (item: RestaurantPaymentMethod) => { return ( - ) } diff --git a/src/pages/paymentMethods/types/Types.ts b/src/pages/paymentMethods/types/Types.ts index c5f68d4..2ccec1d 100644 --- a/src/pages/paymentMethods/types/Types.ts +++ b/src/pages/paymentMethods/types/Types.ts @@ -61,7 +61,6 @@ export type RestaurantPaymentMethod = { updatedAt: string; deletedAt: string | null; restaurant: Restaurant; - title: string; method: string; gateway: string; description: string; @@ -75,7 +74,6 @@ export type RestaurantPaymentMethodResponse = IResponse< >; export type CreateRestaurantPaymentMethodType = { - title: string; method: string; gateway?: string; description: string;