diff options
| author | trisusilo48 <tri.susilo@altama.co.id> | 2024-11-13 14:46:59 +0700 |
|---|---|---|
| committer | trisusilo48 <tri.susilo@altama.co.id> | 2024-11-13 14:46:59 +0700 |
| commit | 7966f67569d01c25f7a337962d7d0bb1a0c57808 (patch) | |
| tree | 7069dae9adba31fd8dba56bbdaecaaa391e86654 /src/lib/checkout/api/getRatesCourier.js | |
| parent | ebba81f144b860eaf3bd7a9ef2b1c63a2ff021e0 (diff) | |
get couries, mapping couries and service
Diffstat (limited to 'src/lib/checkout/api/getRatesCourier.js')
| -rw-r--r-- | src/lib/checkout/api/getRatesCourier.js | 22 |
1 files changed, 22 insertions, 0 deletions
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 |
