summaryrefslogtreecommitdiff
path: root/src/lib/checkout/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/checkout/api')
-rw-r--r--src/lib/checkout/api/ExpedisiList.js25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/lib/checkout/api/ExpedisiList.js b/src/lib/checkout/api/ExpedisiList.js
index ca22bec1..110295b7 100644
--- a/src/lib/checkout/api/ExpedisiList.js
+++ b/src/lib/checkout/api/ExpedisiList.js
@@ -1,8 +1,23 @@
-import odooApi from '@/core/api/odooApi'
+import odooApi from '@/core/api/odooApi';
+import axios from 'axios';
+import biteShipAPI from '../../../core/api/biteShip';
const ExpedisiList = async () => {
- const dataExpedisi = await odooApi('GET', '/api/v1/courier')
- return dataExpedisi
-}
+ const dataExpedisi = await odooApi('GET', '/api/v1/courier');
+ return dataExpedisi;
+};
-export default ExpedisiList
+const GetRatesCourierBiteship = async ({ destination, items }) => {
+ const couriers = process.env.NEXT_PUBLIC_BITESHIP_CODE_COURIERS;
+ let body = {
+ destination,
+ couriers: couriers,
+ items
+ };
+
+ const featch = await biteShipAPI('POST', '/v1/rates/couriers', body);
+
+ return featch;
+};
+
+export { GetRatesCourierBiteship, ExpedisiList} ;