update payment method
This commit is contained in:
@@ -60,7 +60,7 @@ const UpdatePaymentMethod: FC = () => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (restaurantPaymentMethod) {
|
if (restaurantPaymentMethod) {
|
||||||
formik.setValues({
|
formik.setValues({
|
||||||
paymentMethodId: restaurantPaymentMethod.paymentMethodId || '',
|
paymentMethodId: restaurantPaymentMethod.paymentMethod?.id || '',
|
||||||
merchantId: restaurantPaymentMethod.merchantId || '',
|
merchantId: restaurantPaymentMethod.merchantId || '',
|
||||||
isActive: restaurantPaymentMethod.isActive ?? true,
|
isActive: restaurantPaymentMethod.isActive ?? true,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -49,6 +49,9 @@ export const getPaymentMethodTableColumns = ({ onDelete, isDeleting }: GetPaymen
|
|||||||
{
|
{
|
||||||
key: 'merchantId',
|
key: 'merchantId',
|
||||||
title: 'شناسه مرچنت',
|
title: 'شناسه مرچنت',
|
||||||
|
render: (item: RestaurantPaymentMethod) => {
|
||||||
|
return item.merchantId || '-'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'actions',
|
key: 'actions',
|
||||||
|
|||||||
@@ -15,16 +15,54 @@ export type PaymentMethod = {
|
|||||||
|
|
||||||
export type PaymentMethodsResponse = IResponse<PaymentMethod[]>;
|
export type PaymentMethodsResponse = IResponse<PaymentMethod[]>;
|
||||||
|
|
||||||
|
export type GeoJSONPoint = [number, number];
|
||||||
|
|
||||||
|
export type GeoJSONPolygon = {
|
||||||
|
type: "Polygon";
|
||||||
|
coordinates: GeoJSONPoint[][];
|
||||||
|
};
|
||||||
|
|
||||||
|
export type Restaurant = {
|
||||||
|
id: string;
|
||||||
|
createdAt: string;
|
||||||
|
updatedAt: string;
|
||||||
|
deletedAt: string | null;
|
||||||
|
name: string;
|
||||||
|
slug: string;
|
||||||
|
logo: string | null;
|
||||||
|
address: string | null;
|
||||||
|
menuColor: string | null;
|
||||||
|
latitude: number | null;
|
||||||
|
longitude: number | null;
|
||||||
|
serviceArea: GeoJSONPolygon;
|
||||||
|
isActive: boolean;
|
||||||
|
establishedYear: number | null;
|
||||||
|
phoneNumber: string | null;
|
||||||
|
phone: string;
|
||||||
|
instagram: string | null;
|
||||||
|
telegram: string | null;
|
||||||
|
whatsapp: string | null;
|
||||||
|
description: string | null;
|
||||||
|
seoTitle: string | null;
|
||||||
|
seoDescription: string | null;
|
||||||
|
tagNames: unknown | null;
|
||||||
|
images: unknown | null;
|
||||||
|
vat: number;
|
||||||
|
};
|
||||||
|
|
||||||
export type RestaurantPaymentMethodsResponse = IResponse<
|
export type RestaurantPaymentMethodsResponse = IResponse<
|
||||||
RestaurantPaymentMethod[]
|
RestaurantPaymentMethod[]
|
||||||
>;
|
>;
|
||||||
|
|
||||||
export type RestaurantPaymentMethod = {
|
export type RestaurantPaymentMethod = {
|
||||||
id: string;
|
id: string;
|
||||||
paymentMethodId: string;
|
createdAt: string;
|
||||||
merchantId: string;
|
updatedAt: string;
|
||||||
|
deletedAt: string | null;
|
||||||
|
restaurant: Restaurant;
|
||||||
|
paymentMethod: PaymentMethod;
|
||||||
|
merchantId: string | null;
|
||||||
isActive: boolean;
|
isActive: boolean;
|
||||||
paymentMethod?: PaymentMethod;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export type RestaurantPaymentMethodResponse = IResponse<
|
export type RestaurantPaymentMethodResponse = IResponse<
|
||||||
|
|||||||
Reference in New Issue
Block a user