summaryrefslogtreecommitdiff
path: root/src-migrate/services
diff options
context:
space:
mode:
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);
+};