diff options
| author | Miqdad <ahmadmiqdad27@gmail.com> | 2025-05-07 11:51:15 +0700 |
|---|---|---|
| committer | Miqdad <ahmadmiqdad27@gmail.com> | 2025-05-07 11:51:15 +0700 |
| commit | 11ea9426239b88181e5074a8e7246f8955346180 (patch) | |
| tree | 5d2eecafb47a364a7f49b14830d9056689c72eab | |
| parent | 29db3ca16589f1c6bad42545b56b1cb3a6039f4c (diff) | |
<miqdad> Remove unused code
| -rw-r--r-- | src-migrate/types/product.ts | 14 | ||||
| -rw-r--r-- | src/lib/checkout/api/checkoutApi.js | 8 |
2 files changed, 0 insertions, 22 deletions
diff --git a/src-migrate/types/product.ts b/src-migrate/types/product.ts index e2121dab..746cdd4a 100644 --- a/src-migrate/types/product.ts +++ b/src-migrate/types/product.ts @@ -36,20 +36,6 @@ export interface IProduct { logo: string; }; voucher_pasti_hemat: any; - available_voucher?: IVoucher[]; -} - -export interface IVoucher { - id: number; - name: string; - code: string; - description: string; - image: string; - canApply: boolean; - discountVoucher: number; - termsConditions: string; - remaining_time: string; - apply_type: 'all' | 'shipping' | 'brand'; } export interface IProductDetail extends IProduct { diff --git a/src/lib/checkout/api/checkoutApi.js b/src/lib/checkout/api/checkoutApi.js index 39d25068..fd982fff 100644 --- a/src/lib/checkout/api/checkoutApi.js +++ b/src/lib/checkout/api/checkoutApi.js @@ -18,11 +18,3 @@ export const getProductsCheckout = async (query) => { const result = await odooApi('GET', url); return result; }; - -async function checkVoucherApplicability(voucherId, productCategoryId) { - const response = await fetch( - `/api/voucher/${voucherId}/check_applicability?category_id=${productCategoryId}` - ); - const data = await response.json(); - return data.is_applicable; // true jika voucher berlaku untuk kategori, false jika tidak -} |
