From 36c5ca068099cb3642d7ffc2e2eefd8079139876 Mon Sep 17 00:00:00 2001 From: hamid zarghami Date: Wed, 23 Apr 2025 16:43:14 +0330 Subject: [PATCH] fix bug sidcount --- src/langs/fa.json | 4 ++- src/pages/discounts/List.tsx | 7 ++--- src/pages/discounts/types/DiscountTypes.ts | 32 ++++------------------ 3 files changed, 11 insertions(+), 32 deletions(-) diff --git a/src/langs/fa.json b/src/langs/fa.json index b9ef1ad..d65f2e8 100644 --- a/src/langs/fa.json +++ b/src/langs/fa.json @@ -467,7 +467,9 @@ "service": "سرویس", "status": "وضعیت", "active": "فعال", - "deactive": "غیرفعال" + "deactive": "غیرفعال", + "0": "درصد", + "1": "تومان" }, "empty": { "empty_my_service": "سرویسی یافت نشد.", diff --git a/src/pages/discounts/List.tsx b/src/pages/discounts/List.tsx index 194072f..9005c53 100644 --- a/src/pages/discounts/List.tsx +++ b/src/pages/discounts/List.tsx @@ -29,8 +29,6 @@ const MyDiscountList: FC = () => { - - @@ -44,10 +42,9 @@ const MyDiscountList: FC = () => { - - - {item.isActive ? {t('discount.active')} : {t('discount.inactive')}} + {item.value} + {item.type === 0 ? 'درصد' : 'تومان'} ) diff --git a/src/pages/discounts/types/DiscountTypes.ts b/src/pages/discounts/types/DiscountTypes.ts index ab41620..12f1684 100644 --- a/src/pages/discounts/types/DiscountTypes.ts +++ b/src/pages/discounts/types/DiscountTypes.ts @@ -1,30 +1,10 @@ export type DiscountItemType = { - id: string; - createdAt: string; - updatedAt: string; - title: string; - type: string; - calculationType: string; - amount: number; - isActive: boolean; code: string; - startDate: string; + createdAt: string; endDate: string; - subscriptionPlans: { - id: string; - createdAt: string; - updatedAt: string; - name: string; - duration: number; - price: number; - isActive: boolean; - service: { - id: string; - name: string; - title: string; - description: string; - link: string; - icon: string; - }; - }[]; + id: string; + startDate: string; + title: string; + type: number; + value: number; };