cancellerd order screen done and api done

This commit is contained in:
ROSHAN GARG 2024-09-20 16:36:48 +05:30
parent 6504fcf349
commit db18d3fc4c
2 changed files with 31 additions and 4 deletions

View File

@ -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",

View File

@ -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: {