diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2024-08-02 03:25:54 +0000 |
|---|---|---|
| committer | trisusilo <tri.susilo@altama.co.id> | 2024-08-02 03:25:54 +0000 |
| commit | 99a5965e1e5320e9acbc9718c3642ffae85bec57 (patch) | |
| tree | 6a9aeca9b6833d7b87d0ea0a3d79d6bd15862751 /src-migrate/services | |
| parent | 12c7841770052aefceda899db52b3e6b6d0b5e92 (diff) | |
| parent | 35204954ac02efd1497715dec3d2695fdd7976f8 (diff) | |
Merged in Feature/all-promotion (pull request #202)
Feature/all promotion
Approved-by: trisusilo
Diffstat (limited to 'src-migrate/services')
| -rw-r--r-- | src-migrate/services/promotionProgram.ts | 8 | ||||
| -rw-r--r-- | src-migrate/services/voucher.ts | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src-migrate/services/promotionProgram.ts b/src-migrate/services/promotionProgram.ts index c8c46c65..8bf2a0bd 100644 --- a/src-migrate/services/promotionProgram.ts +++ b/src-migrate/services/promotionProgram.ts @@ -6,3 +6,11 @@ export const getPromotionProgram = async ( const url = `/api/promotion-program/${programId}`; return await fetch(url).then((res) => res.json()); }; + +export const getPromotionProgramSolr = async () => { + const response = await fetch(`/solr/promotion_programs/select?indent=true&q.op=OR&q=*:*&fq=banner_s:[* TO *]`); + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); +}; diff --git a/src-migrate/services/voucher.ts b/src-migrate/services/voucher.ts new file mode 100644 index 00000000..13d9e2c0 --- /dev/null +++ b/src-migrate/services/voucher.ts @@ -0,0 +1,8 @@ +import odooApi from '~/libs/odooApi'; +import { IVoucher } from '~/types/voucher'; + +export const getVoucherAll = async (): Promise<IVoucher[]> => { + const url = `/api/v1/voucher`; + + return await odooApi('GET', url); +}; |
