From a26ce0df5c6cc746aed12467cc49e533d45b716c Mon Sep 17 00:00:00 2001 From: pawan-dot <71133473+pawan-dot@users.noreply.github.com> Date: Fri, 3 May 2024 16:28:24 +0530 Subject: [PATCH] change product and razorpay --- src/index.js | 2 +- src/views/InternetConnectionPopUp.js | 9 +- src/views/Products/AddProduct.js | 3 + src/views/Products/EditProduct.js | 5 +- .../Productcomponents/ProductDetails.js | 70 +- src/views/Products/Products.js | 756 +----------------- src/views/Products/ViewProduct.js | 40 +- src/views/orders/ViewOrders.js | 62 +- 8 files changed, 160 insertions(+), 787 deletions(-) diff --git a/src/index.js b/src/index.js index 466639c..3e4516a 100644 --- a/src/index.js +++ b/src/index.js @@ -14,7 +14,7 @@ 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://api.smellika.com"; axios.defaults.headers = { diff --git a/src/views/InternetConnectionPopUp.js b/src/views/InternetConnectionPopUp.js index 1ee2f18..db33aed 100644 --- a/src/views/InternetConnectionPopUp.js +++ b/src/views/InternetConnectionPopUp.js @@ -32,8 +32,15 @@ const InternetConnectionPopUp = () => { title: "Warning", text: "Internet connection is lost. Please check your connection.", icon: "warning", - button: "Retry", + button: { + text: "Retry", + value: "retry", + }, dangerMode: true, + }).then((value) => { + if (value === "retry") { + window.location.reload(); // Reload the page + } })} ); diff --git a/src/views/Products/AddProduct.js b/src/views/Products/AddProduct.js index bb79edd..166d59c 100644 --- a/src/views/Products/AddProduct.js +++ b/src/views/Products/AddProduct.js @@ -41,6 +41,8 @@ const AddProduct = () => { // sku: "", description: "", master_price: "", + master_GST: "", + // discontinue_on: "", // hsn_code: "", product_Status: "", @@ -215,6 +217,7 @@ const AddProduct = () => { diff --git a/src/views/Products/EditProduct.js b/src/views/Products/EditProduct.js index ae11182..2ff686b 100644 --- a/src/views/Products/EditProduct.js +++ b/src/views/Products/EditProduct.js @@ -43,6 +43,7 @@ const EditProduct = () => { // sku: "", description: "", master_price: "", + master_GST: "", // discontinue_on: "", // hsn_code: "", product_Status: "", @@ -89,11 +90,12 @@ const EditProduct = () => { }, }) .then((res) => { - setData((prev) => ({ ...prev, ...res.data?.data, category: res.data?.data?.category?._id, + master_GST: res.data?.data?.master_GST?._id, + product_Status: res.data?.data?.product_Status, // discontinue_on: res.data?.data?.discontinue_on?.slice(0, 10), })); setProductId(res.data?.data?._id); @@ -243,6 +245,7 @@ const EditProduct = () => { diff --git a/src/views/Products/Productcomponents/ProductDetails.js b/src/views/Products/Productcomponents/ProductDetails.js index 98b525d..2672694 100644 --- a/src/views/Products/Productcomponents/ProductDetails.js +++ b/src/views/Products/Productcomponents/ProductDetails.js @@ -8,6 +8,8 @@ const ProductDetails = (props) => { const { data, setData } = props.data; const { productId, setProductId } = props.ProductId; const { loading, setLoading } = props.loading; + const taxes = props.taxes; + const categories = props?.categories || []; const handleChange = (e) => { @@ -26,7 +28,8 @@ const ProductDetails = (props) => { const handleSubmit = () => { if ( data.name.trim() === "" || - // data.master_price.trim() === "" || + data.master_price === "" || + data.master_GST === "" || data.category === "" || data.description === "" || data.product_Status === "" @@ -102,19 +105,6 @@ const ProductDetails = (props) => { />
- {/*
- - handleChange(e)} - /> -
*/}
+
- {/* - handleChange(e)} - /> */} {" "} @@ -167,6 +147,44 @@ const ProductDetails = (props) => {
+
+
+ + handleChange(e)} + /> +
+
+ + +
+