diff options
| author | Miqdad <ahmadmiqdad27@gmail.com> | 2025-08-18 14:09:03 +0700 |
|---|---|---|
| committer | Miqdad <ahmadmiqdad27@gmail.com> | 2025-08-18 14:09:03 +0700 |
| commit | ec558075368b987225e7a96993c2a2d39a4bcf51 (patch) | |
| tree | 96d6a403c33a19b6a2570be0c02415b251920335 /src/lib | |
| parent | 6c731073abb2cdaa67c503c17fdd5420c87bbe01 (diff) | |
<Miqdad> Use child property payment term
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/checkout/api/checkoutApi.js | 10 | ||||
| -rw-r--r-- | src/lib/quotation/components/Quotation.jsx | 6 |
2 files changed, 13 insertions, 3 deletions
diff --git a/src/lib/checkout/api/checkoutApi.js b/src/lib/checkout/api/checkoutApi.js index c30d9631..11c7d4c2 100644 --- a/src/lib/checkout/api/checkoutApi.js +++ b/src/lib/checkout/api/checkoutApi.js @@ -11,6 +11,16 @@ export const checkoutApi = async ({ data }) => { return dataCheckout; }; +export const checkoutQuotation = async (data) => { + const auth = getAuth(); + const qs = new URLSearchParams({ context: 'quotation' }).toString(); + return odooApi( + 'POST', + `/api/v1/partner/${auth.partnerId}/sale_order/checkout?${qs}`, + data + ); +}; + export const getProductsCheckout = async (query) => { const queryParam = new URLSearchParams(query); const userId = getAuth()?.id; diff --git a/src/lib/quotation/components/Quotation.jsx b/src/lib/quotation/components/Quotation.jsx index f0791512..c7e5b16a 100644 --- a/src/lib/quotation/components/Quotation.jsx +++ b/src/lib/quotation/components/Quotation.jsx @@ -33,7 +33,7 @@ import ExpedisiList from '../../checkout/api/ExpedisiList'; import SectionQuotationExpedition from '@/lib/checkout/components/SectionQuotationExpedition'; import { useQuotation } from '@/lib/checkout/stores/stateQuotation'; -const { checkoutApi } = require('@/lib/checkout/api/checkoutApi'); +const { checkoutApi, checkoutQuotation } = require('@/lib/checkout/api/checkoutApi'); const { getProductsCheckout } = require('@/lib/checkout/api/checkoutApi'); const Quotation = () => { @@ -243,8 +243,8 @@ const Quotation = () => { note_website: note_websiteText, }; - const isSuccess = await checkoutApi({ data }); - + const isSuccess = await checkoutQuotation(data); + if (isSuccess?.id) { for (const product of products) { deleteItemCart({ productId: product.id }); |
