bindushahi / Business-Websitee

1 stars 0 forks source link

regarding running a project #1

Closed ilanchez closed 7 months ago

ilanchez commented 7 months ago

https://github.com/ayushmakafle/EaseFloww , I seen your working in the project , i would like to use this as a model for my college project , however I am having issue in deploy in localhost parcticulary on npm , can you able to help me if you dont mind ?

bindushahi commented 7 months ago

what exact issue you're facing, such as error messages ?

ilanchez commented 7 months ago

yeah , i do face some error on npm install on Screenshot from 2024-03-22 19-12-16 (i think this issue not a problem i dont know exactly)

but on the when using npm run client im facing few issues Screenshot from 2024-03-22 19-16-36 same goes for backend as well Screenshot from 2024-03-22 19-17-58

if there is anyway is it possible to fix it ? any solution will be helpful , Thankyou !

bindushahi commented 7 months ago

i don't think first one is the actual problem, so for the problem on myorder side i will give the code that i have import React, { useState, useEffect } from "react"; import UserMenu from "./UserMenu"; import axios from "axios"; import { Table, Spin, Button, Modal, Descriptions } from "antd"; import MainFooter from "../components/footer";

const MyOrders = () => { const [orders, setOrders] = useState([]); const [loading, setLoading] = useState(false); const [error, setError] = useState(null); const [visible, setVisible] = useState(false); // Modal visibility state const [selectedOrder, setSelectedOrder] = useState(null); // Selected order for modal

useEffect(() => { fetchUserOrders(); }, []);

const fetchUserOrders = async () => { try { setLoading(true); setError(null);

  const response = await axios.get("/api/v1/order/orders");

  if (response.data.success) {
    setOrders(response.data.orders);
  } else {
    setError(response.data.message);
  }
} catch (error) {
  console.error("Error fetching user orders:", error.message);
  setError("An error occurred while fetching orders.");
} finally {
  setLoading(false);
}

};

const columns = [ { title: "Order ID", dataIndex: "_id", key: "_id", }, { title: "Total Price in NPR", dataIndex: "totalPrice", key: "totalPrice", }, { title: "Paid At", dataIndex: "paidAt", key: "paidAt", render: (paidAt) => (

{paidAt ? new Date(paidAt).toLocaleString() : "Not Paid"}

  ),
},
{
  title: "Shipping",
  dataIndex: "isDelivered",
  key: "isDelivered",
  render: (isDelivered, record) => {
    const deliveredAtDate = new Date(record.deliveredAt);

    return (
      <>
        {isDelivered
          ? isNaN(deliveredAtDate) ||
            deliveredAtDate.toString() === "Invalid Date"
            ? "Completed"
            : `Completed at ${deliveredAtDate.toLocaleString()}`
          : "Dispatched"}
      </>
    );
  },
},
{
  title: "Your Order Details!",
  dataIndex: "_id",
  key: "actions",
  render: (orderId) => (
    <Button
      onClick={() => handleViewMore(orderId)}
      style={{ backgroundColor: "#B80F4A", color: "white" }}
    >
      View more
    </Button>
  ),
},

]; const handleViewMore = (orderId) => { // Find the selected order const selectedOrder = orders.find((order) => order._id === orderId); setSelectedOrder(selectedOrder); setVisible(true); };

const handleModalCancel = () => { setVisible(false); };

return ( <>

My Orders

{loading && } {error &&

Error: {error}

} {orders.length === 0 ? (

No orders found.

) : ( <> {selectedOrder && (

Product List

{selectedOrder.orderItems.map((item) => ( ))}
Product Name Quantity
{item.name} {item.qyt}
)} )}
  <MainFooter />
</>

); };

export default MyOrders;

And for the backend problem there might be the installation problem on packages.

On Fri, Mar 22, 2024 at 7:35 PM ilanchez @.***> wrote:

yeah , i do face some error on npm install on Screenshot.from.2024-03-22.19-12-16.png (view on web) https://github.com/bindushahi/Business-Websitee/assets/162957889/4c9f1985-80da-4a65-ba88-359439815498 (i think this issue not a problem i dont know exactly)

but on the when using npm run client im facing few issues Screenshot.from.2024-03-22.19-16-36.png (view on web) https://github.com/bindushahi/Business-Websitee/assets/162957889/5d646327-99b2-4450-ab63-e42c92e7c615 same goes for backend as well Screenshot.from.2024-03-22.19-17-58.png (view on web) https://github.com/bindushahi/Business-Websitee/assets/162957889/bcee8092-122b-40eb-b131-58ad8533a8ea

if there is anyway is it possible to fix it ? any solution will be helpful , Thankyou !

— Reply to this email directly, view it on GitHub https://github.com/bindushahi/Business-Websitee/issues/1#issuecomment-2015152342, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOPLH5VC2M536IL5433UBWTYZQZKTAVCNFSM6AAAAABFCXZ6EGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJVGE2TEMZUGI . You are receiving this because you commented.Message ID: @.***>

ilanchez commented 7 months ago

okay , will give it a try ,Thankyou !

ilanchez commented 7 months ago

solved the Myorder.js and backend configure issue as well , the final issue I was facing is bootstrap.min.css Screenshot from 2024-03-23 09-14-37 Tried using chatgpt as well but im not sure what the exact problem , any idea will be helpful !

ilanchez commented 7 months ago

Screenshot from 2024-03-23 09-18-06

bindushahi commented 7 months ago

i can't figure out whats the issue there i can provide you the code i.e. @charset "UTF-8";/*!

ilanchez commented 7 months ago

okay , will try some other method , Thankyou

ilanchez commented 7 months ago

Screenshot from 2024-03-23 09-41-54

I think its incomplete code which you sent , no need to resent it , I think these is problem in my side , will try it figure it out.Thanks