summaryrefslogtreecommitdiff
path: root/src-migrate/services
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-08-20 16:12:25 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-08-20 16:12:25 +0700
commit5c5eef9d62efd83f52f7c37dacb94d50ff7cb915 (patch)
tree7fdef4f99f0f42e2d99a40bfd5b81f1ca5f4ef30 /src-migrate/services
parent004a9a644aed65d5c02263f19cce8b7c3000f354 (diff)
parent6d302bb338e26810a7f90326b84086217f1f4ae0 (diff)
Merge branch 'release' into Feature/category-management
Diffstat (limited to 'src-migrate/services')
-rw-r--r--src-migrate/services/promotionProgram.ts8
-rw-r--r--src-migrate/services/voucher.ts8
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);
+};