diff --git a/k8s/deployment.yaml b/k8s/deployment.yaml index 46fc5a7..1615e05 100644 --- a/k8s/deployment.yaml +++ b/k8s/deployment.yaml @@ -22,10 +22,9 @@ spec: spec: containers: - name: ecommerce-admin-panel - # Replace with your actual registry image - # Build with: docker build --build-arg VITE_API_URL=https://api.yourdomain.com . - image: your-registry/ecommerce-admin-panel:latest - imagePullPolicy: Always + # Using local image built in minikube docker-env + image: ecommerce-admin-panel:latest + imagePullPolicy: IfNotPresent ports: - containerPort: 80 protocol: TCP diff --git a/k8s/service.yaml b/k8s/service.yaml index 0e0a153..20ffbf3 100644 --- a/k8s/service.yaml +++ b/k8s/service.yaml @@ -13,4 +13,5 @@ spec: protocol: TCP port: 80 targetPort: 80 - type: ClusterIP + nodePort: 30082 + type: NodePort diff --git a/src/pages/Dashboard/DashboardPage.jsx b/src/pages/Dashboard/DashboardPage.jsx index 00d2d68..fe7a92b 100644 --- a/src/pages/Dashboard/DashboardPage.jsx +++ b/src/pages/Dashboard/DashboardPage.jsx @@ -1821,7 +1821,7 @@ const Dashboard = () => { const productId = order.items?.[0]?.productId; if (productId) { - const product = stats.topProducts.find((p) => p._id === productId); + const product = stats.topProducts?.find((p) => p._id === productId); if (product?.displayImage) { return product.displayImage; } @@ -1836,7 +1836,7 @@ const Dashboard = () => { return productDetails.name; } - const product = stats.topProducts.find( + const product = stats.topProducts?.find( (p) => p._id === order.items[0]?.productId ); @@ -2500,7 +2500,7 @@ const Dashboard = () => {
- ₹{parseFloat(order.totalAmount).toLocaleString()} + ₹{(parseFloat(order.totalAmount) || 0).toLocaleString()}
{order.paymentMethod} @@ -2668,7 +2668,7 @@ const Dashboard = () => {