From 6fc603be8175ac18227378e775273bc9353ce783 Mon Sep 17 00:00:00 2001 From: Sibunnayak Date: Wed, 24 Jul 2024 12:03:05 +0530 Subject: [PATCH 1/3] categories and gst --- src/_nav.js | 58 ++++++++++----------- src/assets/images/avatars/1.jpeg | Bin 0 -> 1789 bytes src/components/header/AppHeaderDropdown.js | 2 +- 3 files changed, 30 insertions(+), 30 deletions(-) create mode 100644 src/assets/images/avatars/1.jpeg diff --git a/src/_nav.js b/src/_nav.js index f264ed6..fd4b82a 100644 --- a/src/_nav.js +++ b/src/_nav.js @@ -46,36 +46,36 @@ const _nav = [ group: "PrincipalDistributor", }, - // { - // component: CNavGroup, - // name: "Product Management", - // icon: , - // group: "", + { + component: CNavGroup, + name: "Product Management", + icon: , + group: "", - // items: [ - // { - // component: CNavItem, - // name: "Categories", - // icon: , - // to: "/categories", - // group: "Product Management", - // }, - // { - // component: CNavItem, - // name: "Products", - // icon: , - // to: "/products", - // group: "Product Management", - // }, - // { - // component: CNavItem, - // name: "GST", - // icon: , - // to: "/tax", - // group: "Product Management", - // }, - // ], - // }, + items: [ + { + component: CNavItem, + name: "Categories", + icon: , + to: "/categories", + group: "Product Management", + }, + // { + // component: CNavItem, + // name: "Products", + // icon: , + // to: "/products", + // group: "Product Management", + // }, + { + component: CNavItem, + name: "GST", + icon: , + to: "/tax", + group: "Product Management", + }, + ], + }, { component: CNavItem, name: "Sales Coordinator", diff --git a/src/assets/images/avatars/1.jpeg b/src/assets/images/avatars/1.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..da1cad12317b1da5c2eefe2d5deb7345757bf132 GIT binary patch literal 1789 zcmb7^YgAKL7RS%MArE4RH%;Ubp(H3J2VgdhYVC=_*g6hR(VD1$Nx3gZjQ zLx>^>$N&+AA|VKL@X-PWhGMjrtjJ5SplzX0A3%H}kO}QfJN+;py3bkX!`^4_^HsLk^K>$Fy1+>G!4G{G31iT)BfF}@%1QHn`llAq<4C-vR-3tVs3}paZpQ+HD_rEL?jZ)Br=^$rgNBvOwOMU?HxcP zfees=gDe0{gK#uR+X}A*Ij)vi6@#_F1D4AvOar*iZr;1slfVEd<+o6A@ zJ7y+E{ghAYYE98hMsfUzq9gp=5TD^l=)bxEPA8KMvMKf*K!7ypbTdg13_-473G@HEphN%b1xo}#Fdm2h9XSN!fF6xy z{{h<{p|2N&N1(rq)VazPZtTwgPBg!D{6U%rThw~3=GAtY6&XF#vYZ`!;0MR!ZG_n^ zEBL3!y}vvdj?F|xUX9*}kSwHzbb&Z4{mJCK7C0Wx_SAp}fuCIa{$^oC*dC_+L)2qK zeCf@d6=N@pLl0D?&)sP5O`mF>GTPqII=FeEbM^~)xt(8r%cxW2PLK1N<(EV?3(Z?b zf}3`(40cE+J~bVA_;Lav@&6t}b^K}12I5A`>ow2P^9Ba(XbJZ=bEdk7Puc$EE>F(g zRPfsBoX5$e*o`|{UN}XHcNQknNzZwnZM&K#;uhNfLkjHSwZ{<;`OCR2j9Se!;)Hj17--((;Sxse+?&aEr%mxW1^ zRA(aU2joux*b(u@#O>nBS@vh2fB2F7N|`7i^;8*OaKfAOj_DR(dE4OKKXos(3el0( zgJD=_?_UF=0hYZ#TY!XTcA$v`Gr!?yH{EWIYE%s?L-$Vxt?9kOXlPCf-aq$PwrO3# z5liUNcHaf;aZc&6eINMmy+FTA>90bMx}1!x;ufBDmfjkUQFd9O;{IHVOoQ9fI`tD& znO&wS%Fo1nS98XP#8lVVT-0h@#eS})4yoazp9WW&1wiN!&pzp-^`pVSeQpBD3by*z zd14@&*?Oi!tOZAFHU{Qt+?RPVbc-Ep@eTFdyu7@S7j_qy0CJW9!g_d}h5tiP2awIO z4^I^MXBIRf9jeFEl{3Ga7-*OiZPFqXN1Wd#=$Zao^{(BmT{L6wbQ7Fw&(^NhLQ`Vv`f|Ld@X(^HO>^q{!dJfg zUmN;&zKZ(#psV2>1eOUrl&YjEdi6eE)i(+9(2Z@`bKd)3_c&GWeiLWGnuDq}28=h^-ol{XKs>xe@ zaGhQ}MG^}<9nys4?-7=SewJ5Wn@aZStBk&h@dhh$dLI;&_ypyo73IcQUzYlNqU^3( zP-gxNYW zeTtsdik=8u=*K^=9qsKun-FG7A@s4AIlSFKJtiq&czGkT@Q}r>xc4g>p6+UE^x7`H z1k3kU Date: Wed, 24 Jul 2024 12:59:24 +0530 Subject: [PATCH 2/3] categories and gst --- src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index adbdd11..b47a948 100644 --- a/src/index.js +++ b/src/index.js @@ -15,8 +15,8 @@ import { cibGmail } from "@coreui/icons"; import { createRoot } from "react-dom/client"; const setupAxios = () => { - axios.defaults.baseURL = "http://localhost:5000"; - // axios.defaults.baseURL = "https://cheminova-api-2.onrender.com"; + // axios.defaults.baseURL = "http://localhost:5000"; + axios.defaults.baseURL = "https://cheminova-api-2.onrender.com"; axios.defaults.headers = { "Cache-Control": "no-cache,no-store", From 810d5770b5dba98640916f67e040f0cd5cea5f8f Mon Sep 17 00:00:00 2001 From: Sibunnayak Date: Fri, 26 Jul 2024 08:39:54 +0530 Subject: [PATCH 3/3] product update --- src/_nav.js | 14 +- src/views/Products/AddProduct.js | 220 +---- src/views/Products/EditProduct.js | 798 +----------------- .../Productcomponents/ProductDetails.js | 63 +- .../Productcomponents/ProductImages.js | 330 ++------ .../Productcomponents/ProductVarients.js | 249 ------ src/views/Products/Products.js | 27 +- src/views/Products/ViewProduct.js | 144 +--- 8 files changed, 140 insertions(+), 1705 deletions(-) delete mode 100644 src/views/Products/Productcomponents/ProductVarients.js diff --git a/src/_nav.js b/src/_nav.js index fd4b82a..6d2d62c 100644 --- a/src/_nav.js +++ b/src/_nav.js @@ -60,13 +60,13 @@ const _nav = [ to: "/categories", group: "Product Management", }, - // { - // component: CNavItem, - // name: "Products", - // icon: , - // to: "/products", - // group: "Product Management", - // }, + { + component: CNavItem, + name: "Products", + icon: , + to: "/products", + group: "Product Management", + }, { component: CNavItem, name: "GST", diff --git a/src/views/Products/AddProduct.js b/src/views/Products/AddProduct.js index 166d59c..d2711d1 100644 --- a/src/views/Products/AddProduct.js +++ b/src/views/Products/AddProduct.js @@ -1,23 +1,11 @@ import React, { useState, useEffect } from "react"; import { Button } from "@mui/material"; import axios from "axios"; -// import { API } from "src/API"; -// import { isAutheticated } from "../../components/auth/authhelper"; import { Link, useNavigate } from "react-router-dom"; -import { - CCard, - CCardBody, - CCardGroup, - CCol, - CContainer, - CRow, -} from "@coreui/react"; +import { CCard, CCardBody, CCardGroup, CCol, CContainer, CRow } from "@coreui/react"; import ProductDetails from "./Productcomponents/ProductDetails.js"; -import ProductVarients from "./Productcomponents/ProductVarients.js"; import ProductsImages from "./Productcomponents/ProductImages.js"; import { isAutheticated } from "src/auth.js"; -// import ReleventProduct from "./Productcomponents/ReleventProduct"; -// import ProductFabric from "./Productcomponents/ProductFabric.js"; const AddProduct = () => { const token = isAutheticated(); @@ -26,68 +14,19 @@ const AddProduct = () => { const [images, setImages] = useState([]); const [categories, setCategories] = useState([]); const [taxes, setTaxes] = useState([]); - const [sizes, setSizes] = useState([]); - const [relevantProduct, setRelevantProduct] = useState([]); - const [allreleventSelectedProduct, setallReleventSelectedProduct] = useState( - [] - ); - - const navigate = useNavigate(); const [loading, setLoading] = useState(false); const [data, setData] = useState({ name: "", category: "", - // sku: "", description: "", - master_price: "", - master_GST: "", - - // discontinue_on: "", - // hsn_code: "", + price: "", + GST: "", product_Status: "", - special_instructions: "", - // productImages.length == 0 || - // gst_amount === "" || - // price === "" || - // totalAmt === "" || - // gst_amount === "" || }); - const [varients, setVarients] = useState([ - { - variant_Name: "", - weight: "", - volume: "", - price: "", - - gst_Id: "", - }, - { - variant_Name: "", - weight: "", - volume: "", - price: "", - - gst_Id: "", - }, - - { - variant_Name: "", - weight: "", - volume: "", - price: "", - - gst_Id: "", - }, - ]); - const [allFabrics, setAllFabrics] = useState([]); - const [fabrics, setFabrics] = useState([ - { _id: "", fabric_Name: "", for_Part: "" }, - { _id: "", fabric_Name: "", for_Part: "" }, - { _id: "", fabric_Name: "", for_Part: "" }, - ]); + const navigate = useNavigate(); const getCategories = () => { axios @@ -101,7 +40,7 @@ const AddProduct = () => { setCategories(res?.data?.categories); setLoading(false); }) - .catch((err) => { + .catch(() => { setLoading(false); }); }; @@ -119,57 +58,11 @@ const AddProduct = () => { }); }; - // const getSizes = () => { - // axios - // .get(`/api/erp/sizemaster/size`, { - // headers: { - // "Access-Control-Allow-Origin": "*", - // Authorization: `Bearer ${token}`, - // }, - // }) - // .then((res) => { - // setSizes(res.data?.data); - // }); - // }; - // const getItemWhichcontaiNameFabric = () => { - // axios - // .get(`/api/erp/item/name_contain_fabric`, { - // headers: { - // "Access-Control-Allow-Origin": "*", - // Authorization: `Bearer ${token}`, - // }, - // }) - // .then((res) => { - // console.log(res?.data); - // // setSizes(res.data?.data) - // setAllFabrics(res?.data?.data); - // }) - // .catch((err) => { - // console.log(err); - // }); - // }; - - // const getProductsData = async () => { - // axios - // .get(`/api/product`, { - // headers: { - // Authorization: `Bearer ${token}`, - // }, - // }) - // .then((res) => { - // setRelevantProduct(res.data?.data); - // }) - // .catch((err) => { - // console.log(err); - // }); - // }; useEffect(() => { getCategories(); getTaxes(); - // getSizes(); - // getProductsData(); - // getItemWhichcontaiNameFabric(); }, []); + const handleView = (n) => { if (viewState === n) return; setViewState(n); @@ -179,14 +72,7 @@ const AddProduct = () => { -
+
Add Product : {data?.name && data?.name}
@@ -195,11 +81,7 @@ const AddProduct = () => { @@ -222,15 +104,6 @@ const AddProduct = () => { loading={{ loading, setLoading }} /> )} - {viewState === 2 && ( - - )} {viewState === 3 && ( { loading={{ loading, setLoading }} /> )} - {/* {viewState === 4 && ( - - )} - {viewState === 5 && ( - - )} */} - {/* {viewState === 5 && ( - - )} */} @@ -280,60 +121,19 @@ const AddProduct = () => {
- - {/* */} - {/* */}
diff --git a/src/views/Products/EditProduct.js b/src/views/Products/EditProduct.js index 2ff686b..441741a 100644 --- a/src/views/Products/EditProduct.js +++ b/src/views/Products/EditProduct.js @@ -1,8 +1,6 @@ import React, { useState, useEffect } from "react"; import { Button } from "@mui/material"; import axios from "axios"; -// import { API } from "src/API"; -// import { isAutheticated } from "../../components/auth/authhelper"; import { Link, useNavigate, useParams } from "react-router-dom"; import { CCard, @@ -13,26 +11,18 @@ import { CRow, } from "@coreui/react"; import ProductDetails from "./Productcomponents/ProductDetails.js"; -import ProductVarients from "./Productcomponents/ProductVarients.js"; import ProductsImages from "./Productcomponents/ProductImages.js"; import { isAutheticated } from "src/auth.js"; -// import ReleventProduct from "./Productcomponents/ReleventProduct"; -// import ProductFabric from "./Productcomponents/ProductFabric.js"; const EditProduct = () => { const id = useParams()?.id; - console.log("id", id); + // console.log("id", id); const token = isAutheticated(); const [productId, setProductId] = useState(""); const [viewState, setViewState] = useState(1); const [images, setImages] = useState([]); const [categories, setCategories] = useState([]); const [taxes, setTaxes] = useState([]); - const [sizes, setSizes] = useState([]); - const [relevantProduct, setRelevantProduct] = useState([]); - const [allreleventSelectedProduct, setallReleventSelectedProduct] = useState( - [] - ); const navigate = useNavigate(); const [loading, setLoading] = useState(false); @@ -40,46 +30,13 @@ const EditProduct = () => { const [data, setData] = useState({ name: "", category: "", - // sku: "", description: "", - master_price: "", - master_GST: "", - // discontinue_on: "", - // hsn_code: "", + price: "", + GST: "", product_Status: "", - special_instructions: "", - // productImages.length == 0 || - // gst_amount === "" || - // price === "" || - // totalAmt === "" || - // gst_amount === "" || }); - const [varients, setVarients] = useState([ - { - variant_Name: "", - weight: "", - volume: "", - price: "", - gst_Id: "", - }, - { - variant_Name: "", - weight: "", - volume: "", - price: "", - gst_Id: "", - }, - { - variant_Name: "", - weight: "", - volume: "", - price: "", - gst_Id: "", - }, - ]); - /////////////// const getProduct = () => { axios @@ -90,31 +47,22 @@ const EditProduct = () => { }, }) .then((res) => { + // console.log("res", res.data); setData((prev) => ({ ...prev, ...res.data?.data, category: res.data?.data?.category?._id, - master_GST: res.data?.data?.master_GST?._id, + GST: res.data?.data?.GST?._id, product_Status: res.data?.data?.product_Status, - // discontinue_on: res.data?.data?.discontinue_on?.slice(0, 10), })); setProductId(res.data?.data?._id); setImages([...res.data?.data?.image]); - setVarients([...res.data.data?.variants]); setLoading(false); }) .catch((err) => { setLoading(false); }); }; - ///////////////// - const [allFabrics, setAllFabrics] = useState([]); - const [fabrics, setFabrics] = useState([ - { _id: "", fabric_Name: "", for_Part: "" }, - { _id: "", fabric_Name: "", for_Part: "" }, - { _id: "", fabric_Name: "", for_Part: "" }, - ]); - const getCategories = () => { axios .get(`/api/category/getCategories`, { @@ -141,62 +89,14 @@ const EditProduct = () => { }, }) .then((res) => { - // console.log("tax", res.data); setTaxes(res.data); }); }; - // const getSizes = () => { - // axios - // .get(`/api/erp/sizemaster/size`, { - // headers: { - // "Access-Control-Allow-Origin": "*", - // Authorization: `Bearer ${token}`, - // }, - // }) - // .then((res) => { - // setSizes(res.data?.data); - // }); - // }; - // const getItemWhichcontaiNameFabric = () => { - // axios - // .get(`/api/erp/item/name_contain_fabric`, { - // headers: { - // "Access-Control-Allow-Origin": "*", - // Authorization: `Bearer ${token}`, - // }, - // }) - // .then((res) => { - // console.log(res?.data); - // // setSizes(res.data?.data) - // setAllFabrics(res?.data?.data); - // }) - // .catch((err) => { - // console.log(err); - // }); - // }; - - // const getProductsData = async () => { - // axios - // .get(`/api/product`, { - // headers: { - // Authorization: `Bearer ${token}`, - // }, - // }) - // .then((res) => { - // setRelevantProduct(res.data?.data); - // }) - // .catch((err) => { - // console.log(err); - // }); - // }; useEffect(() => { getProduct(); getCategories(); getTaxes(); - // getSizes(); - // getProductsData(); - // getItemWhichcontaiNameFabric(); }, []); const handleView = (n) => { if (viewState === n) return; @@ -250,15 +150,6 @@ const EditProduct = () => { loading={{ loading, setLoading }} /> )} - {viewState === 2 && ( - - )} {viewState === 3 && ( { loading={{ loading, setLoading }} /> )} - {/* {viewState === 4 && ( - - )} - {viewState === 5 && ( - - )} */} - {/* {viewState === 5 && ( - - )} */} @@ -318,17 +177,6 @@ const EditProduct = () => { > Product Details - - {/* */} - {/* */}
@@ -373,617 +199,3 @@ const EditProduct = () => { }; export default EditProduct; -// import React, { useEffect, useState } from "react"; -// import Button from "@material-ui/core/Button"; -// import { Link, useNavigate, useParams } from "react-router-dom"; -// import swal from "sweetalert"; -// import axios from "axios"; -// import { isAutheticated } from "src/auth"; - -// import CloudUploadIcon from "@mui/icons-material/CloudUpload"; -// import DeleteSharpIcon from "@mui/icons-material/DeleteSharp"; -// import { -// Box, -// FormControl, -// IconButton, -// MenuItem, -// Select, -// TextField, -// } from "@mui/material"; -// // import { WebsiteURL } from '../WebsiteURL' - -// const EditProduct = () => { -// const id = useParams()?.id; - -// const token = isAutheticated(); -// const navigate = useNavigate(); - -// const [loading, setLoading] = useState(false); -// const [allTax, setAllTax] = useState([]); -// const [categories, setCatgories] = useState([]); -// const [imagesPreview, setImagesPreview] = useState([]); -// const [name, setName] = useState(""); -// const [description, setDescription] = useState(""); -// const [productImages, setProductImages] = useState([]); -// const [price, setPrice] = useState(""); -// const [category, setCategoryName] = useState(""); -// const [error, setError] = useState(""); -// const [initTax, setInitTax] = useState(); -// const [selectedTax, setselectedTax] = useState(); -// const [product_Status, setproduct_Status] = useState(""); - -// const [totalAmt, setTotalAmt] = useState(0); -// const [gst_amount, setGst_amount] = useState(0); -// const [newUpdatedImages, setNewUpdatedImages] = useState([]); - -// //get Productdata -// const getProduct = async () => { -// axios -// .get(`/api/product/getOne/${id}`, { -// headers: { -// "Access-Control-Allow-Origin": "*", -// Authorization: `Bearer ${token}`, -// }, -// }) -// .then((res) => { -// setName(res?.data?.product.name); -// setDescription(res.data.product.description); -// setProductImages(res.data.product.image); -// setPrice(res.data.product.price); -// setCategoryName(res.data.product?.category?._id); -// setselectedTax(res.data.product?.gst); -// setInitTax(res.data.product?.gst?._id); -// setTotalAmt(res.data.product?.total_amount); -// setGst_amount(res.data.product?.gst_amount); -// setproduct_Status(res.data.product?.product_Status); -// }) -// .catch((err) => { -// swal({ -// title: error, -// text: " Can not fetch the product ", -// icon: "error", -// button: "Retry", -// dangerMode: true, -// }); -// }); -// }; -// // console.log(selectedTax, "selectedTax"); - -// const getCategories = async () => { -// try { -// const response = await axios.get("/api/category/getCategories", { -// headers: { -// Authorization: `Bearer ${token}`, -// }, -// }); - -// if (response.status === 200) { -// setCatgories(response?.data?.categories); -// } -// } catch (error) { -// swal({ -// title: error, -// text: " please login to access the resource ", -// icon: "error", -// button: "Retry", -// dangerMode: true, -// }); -// } -// }; -// useEffect(() => { -// getProduct(); -// getCategories(); -// }, []); - -// useEffect(() => { -// const getAllTax = async () => { -// const res = await axios.get(`/api/tax/view_tax`, { -// headers: { -// "Access-Control-Allow-Origin": "*", -// Authorization: `Bearer ${token}`, -// }, -// }); -// if (res.data) { -// setAllTax(res.data); -// } -// }; -// getAllTax(); -// }, [token]); -// const TaxRatechange = async (e) => { -// let m = JSON.parse(e.target.value); -// setInitTax(""); -// if (m?.tax) { -// let totalprice = Number(price) + Number((price * m?.tax) / 100); -// setGst_amount(Number((price * m?.tax) / 100)?.toFixed(2)); -// setTotalAmt(totalprice?.toFixed(2)); -// setselectedTax(m?._id); -// } -// }; -// // console.log(selectedTax, "inisele"); -// const handlePriceChange = (e) => { -// const newPrice = e.target.value; - -// setPrice(newPrice); -// const selectedTaxObj = allTax.find( -// (t) => -// t._id === -// (typeof selectedTax === "object" ? selectedTax._id : selectedTax) -// ); -// // console.log(selectedTax); -// // console.log(selectedTaxObj, "this is ", selectedTax); - -// if (selectedTaxObj && !isNaN(newPrice)) { -// const gstAmount = (newPrice * selectedTaxObj.tax) / 100; -// const totalAmount = Number(newPrice) + gstAmount; - -// setGst_amount(gstAmount.toFixed(2)); -// setTotalAmt(totalAmount.toFixed(2)); -// } -// }; -// const handleSubmit = () => { -// // console.log("selected Tax", selectedTax); -// if ( -// name === "" || -// description === "" || -// productImages.length == 0 || -// category === "" || -// selectedTax === "" || -// gst_amount === "" || -// price === "" || -// product_Status === "" || -// totalAmt === "" || -// gst_amount === "" || -// (productImages.length == 0 && newUpdatedImages.length == 0) -// ) { -// swal({ -// title: "Warning", -// text: "Fill all mandatory fields", -// icon: "error", -// button: "Close", -// dangerMode: true, -// }); -// return; -// } -// setLoading(true); -// const formData = new FormData(); -// formData.append("name", name); - -// formData.append("description", description); -// formData.append("price", price); -// formData.append("category", category); -// formData.append("total_amount", totalAmt); -// formData.append("gst_amount", gst_amount); -// formData.append("product_Status", product_Status); - -// formData.append("gst", initTax === "" ? selectedTax : initTax); - -// newUpdatedImages.length > 0 && -// newUpdatedImages.forEach((Singleimage) => { -// formData.append("newImages", Singleimage); -// }); - -// formData.append("image", JSON.stringify(productImages)); - -// axios -// .patch(`/api/product/update/${id}`, formData, { -// headers: { -// Authorization: `Bearer ${token}`, -// "Content-Type": "multipart/form-data", - -// "Access-Control-Allow-Origin": "*", -// }, -// }) -// .then((res) => { -// swal({ -// title: "Updated", -// text: "Product Updated successfully!", -// icon: "success", -// button: "ok", -// }); -// setLoading(false); -// navigate("/products", { replace: true }); -// }) -// .catch((err) => { -// setLoading(false); - -// const message = err.response?.data?.message -// ? err.response?.data?.message -// : "Something went wrong!"; -// swal({ -// title: "Warning", -// text: message, -// icon: "error", -// button: "Retry", -// dangerMode: true, -// }); -// }); -// }; -// const handleFileChange = (e) => { -// const files = e.target.files; - -// // Check the total number of selected files -// if (newUpdatedImages.length + files.length > 4 - productImages.length) { -// setError("You can only upload up to 4 images."); -// return; -// } - -// // Check file types and append to selectedFiles -// const allowedTypes = ["image/jpeg", "image/png", "image/jpg"]; -// const selected = []; - -// for (let i = 0; i < files.length; i++) { -// if ( -// newUpdatedImages.length + selected.length >= -// 4 - productImages.length -// ) { -// break; // Don't allow more than 4 images -// } - -// if (allowedTypes.includes(files[i].type)) { -// selected.push(files[i]); -// } -// } - -// if (selected.length === 0) { -// setError("Please upload only PNG, JPEG, or JPG files."); -// } else { -// setError(""); -// setNewUpdatedImages([...newUpdatedImages, ...selected]); -// } -// }; - -// const handelDelete = async (public_id) => { -// const ary = public_id.split("/"); - -// const res = await axios.delete( -// `/api/product/deleteImage/jatinMor/product/${ary[2]}`, -// { -// headers: { -// "Access-Control-Allow-Origin": "*", -// Authorization: `Bearer ${token}`, -// }, -// } -// ); -// if (res) { -// const filtered = productImages.filter( -// (item) => item.public_id !== public_id -// ); -// setProductImages(filtered); -// } -// }; -// const handellocalDelete = (image) => { -// const filtered = productImages.filter((item) => item !== image); -// setProductImages(filtered); -// }; -// return ( -//
-//
-//
-//
-//
-// Edit Product -//
-//
-//

-//
- -//
-// -// -// -// -//
-//
-//
-//
-//
-//
-//
-//
-//
-// -// setName(e.target.value)} -// /> -// {name ? ( -// <> -// -// {35 - name.length} characters left -// -// -// ) : ( -// <> -// )}{" "} -//
- -//
-// -//