From ebba81f144b860eaf3bd7a9ef2b1c63a2ff021e0 Mon Sep 17 00:00:00 2001 From: trisusilo48 Date: Thu, 7 Nov 2024 12:59:56 +0700 Subject: get couries biteship --- src/lib/checkout/api/ExpedisiList.js | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'src/lib/checkout/api') 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} ; -- cgit v1.2.3 From 7966f67569d01c25f7a337962d7d0bb1a0c57808 Mon Sep 17 00:00:00 2001 From: trisusilo48 Date: Wed, 13 Nov 2024 14:46:59 +0700 Subject: get couries, mapping couries and service --- src/lib/checkout/api/ExpedisiList.js | 18 +----------------- src/lib/checkout/api/getRatesCourier.js | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 17 deletions(-) create mode 100644 src/lib/checkout/api/getRatesCourier.js (limited to 'src/lib/checkout/api') diff --git a/src/lib/checkout/api/ExpedisiList.js b/src/lib/checkout/api/ExpedisiList.js index 110295b7..67ef93e2 100644 --- a/src/lib/checkout/api/ExpedisiList.js +++ b/src/lib/checkout/api/ExpedisiList.js @@ -1,23 +1,7 @@ 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 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} ; +export default ExpedisiList; diff --git a/src/lib/checkout/api/getRatesCourier.js b/src/lib/checkout/api/getRatesCourier.js new file mode 100644 index 00000000..8db02d50 --- /dev/null +++ b/src/lib/checkout/api/getRatesCourier.js @@ -0,0 +1,22 @@ +import axios from "axios"; +import biteShipAPI from "../../../core/api/biteShip"; + +const GetRatesCourierBiteship = async ({ destination, items }) => { + const couriers = process.env.NEXT_PUBLIC_BITESHIP_CODE_COURIERS; + let body = { + ...destination, + couriers: 'gojek, grab, deliveree, lalamove, jne, tiki, ninja, lion, rara, sicepat, jnt, pos, idexpress, rpx, wahana, jdl, pos, anteraja, sap, paxel, borzo', + items: items, + }; + + const response = await axios(`${process.env.NEXT_PUBLIC_SELF_HOST}/api/biteship-service?method=POST&url=/v1/rates/couriers&body=` + JSON.stringify(body)); + + // const featch = await biteShipAPI('POST', '/v1/rates/couriers', body); + console.log('ini featch', response); + + + return response; +}; + + +export default GetRatesCourierBiteship \ No newline at end of file -- cgit v1.2.3 From c26a0d026886e6f70ea3487b9d83a54d20b9c1e4 Mon Sep 17 00:00:00 2001 From: trisusilo48 Date: Tue, 28 Jan 2025 09:46:11 +0700 Subject: biteship --- src/lib/checkout/api/checkoutApi.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/lib/checkout/api') diff --git a/src/lib/checkout/api/checkoutApi.js b/src/lib/checkout/api/checkoutApi.js index fd982fff..9d326b10 100644 --- a/src/lib/checkout/api/checkoutApi.js +++ b/src/lib/checkout/api/checkoutApi.js @@ -18,3 +18,14 @@ export const getProductsCheckout = async (query) => { const result = await odooApi('GET', url); return result; }; + +export const getProductsSla = async ({data}) => { + const dataSLA = await odooApi( + 'GET', + `/api/v1/product/variants/sla`, + data + ) + + console.log('ini sla - data', dataSLA); + return dataSLA +} -- cgit v1.2.3 From f88f457fd1b91298ea8a7f9f396e49660a81e276 Mon Sep 17 00:00:00 2001 From: trisusilo48 Date: Mon, 17 Mar 2025 09:06:47 +0700 Subject: handle bug service type kurir --- src/lib/checkout/api/checkoutApi.js | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/lib/checkout/api') diff --git a/src/lib/checkout/api/checkoutApi.js b/src/lib/checkout/api/checkoutApi.js index 9d326b10..c30d9631 100644 --- a/src/lib/checkout/api/checkoutApi.js +++ b/src/lib/checkout/api/checkoutApi.js @@ -25,7 +25,5 @@ export const getProductsSla = async ({data}) => { `/api/v1/product/variants/sla`, data ) - - console.log('ini sla - data', dataSLA); return dataSLA } -- cgit v1.2.3