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";
|
import { createRoot } from "react-dom/client";
|
||||||
|
|
||||||
const setupAxios = () => {
|
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://cheminova-api-2.onrender.com";
|
||||||
axios.defaults.baseURL = "https://api.cnapp.co.in";
|
// axios.defaults.baseURL = "https://api.cnapp.co.in";
|
||||||
|
|
||||||
axios.defaults.headers = {
|
axios.defaults.headers = {
|
||||||
"Cache-Control": "no-cache,no-store",
|
"Cache-Control": "no-cache,no-store",
|
||||||
|
@ -204,12 +204,39 @@ const ViewOrders = () => {
|
|||||||
setOpnePartialModal(false);
|
setOpnePartialModal(false);
|
||||||
};
|
};
|
||||||
const handlePartialProcess = async (availability) => {
|
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 {
|
try {
|
||||||
const cancellationRes = await axios.post(
|
const cancellationRes = await axios.post(
|
||||||
`/api/processing-order`,
|
`/api/processing-order`,
|
||||||
{
|
{
|
||||||
invoiceItems: availability,
|
invoiceItems: prepareData,
|
||||||
orderId: order._id,
|
orderId: id,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
|
Loading…
Reference in New Issue
Block a user