cancellerd order screen done and api done
This commit is contained in:
parent
6504fcf349
commit
db18d3fc4c
@ -15,9 +15,9 @@ import { cibGmail } from "@coreui/icons";
|
||||
import { createRoot } from "react-dom/client";
|
||||
|
||||
const setupAxios = () => {
|
||||
// axios.defaults.baseURL = "http://localhost:5000";
|
||||
axios.defaults.baseURL = "http://localhost:5000";
|
||||
// axios.defaults.baseURL = "https://cheminova-api-2.onrender.com";
|
||||
axios.defaults.baseURL = "https://api.cnapp.co.in";
|
||||
// axios.defaults.baseURL = "https://api.cnapp.co.in";
|
||||
|
||||
axios.defaults.headers = {
|
||||
"Cache-Control": "no-cache,no-store",
|
||||
|
@ -204,12 +204,39 @@ const ViewOrders = () => {
|
||||
setOpnePartialModal(false);
|
||||
};
|
||||
const handlePartialProcess = async (availability) => {
|
||||
const prepareData = availability.map(
|
||||
({
|
||||
productId,
|
||||
SKU,
|
||||
name,
|
||||
categoryName,
|
||||
brandName,
|
||||
price,
|
||||
GST,
|
||||
HSN_Code,
|
||||
description,
|
||||
processquantity,
|
||||
}) => ({
|
||||
productId,
|
||||
SKU,
|
||||
name,
|
||||
categoryName,
|
||||
brandName,
|
||||
price,
|
||||
GST,
|
||||
HSN_Code,
|
||||
description,
|
||||
processquantity,
|
||||
})
|
||||
);
|
||||
console.log(prepareData);
|
||||
|
||||
try {
|
||||
const cancellationRes = await axios.post(
|
||||
`/api/processing-order`,
|
||||
{
|
||||
invoiceItems: availability,
|
||||
orderId: order._id,
|
||||
invoiceItems: prepareData,
|
||||
orderId: id,
|
||||
},
|
||||
{
|
||||
headers: {
|
||||
|
Loading…
Reference in New Issue
Block a user