From 0eab909eb1bf824957649e3532a039ed9a14f1ab Mon Sep 17 00:00:00 2001 From: shafi54 <108669266+shafi-aviz@users.noreply.github.com> Date: Sun, 2 Aug 2026 11:12:16 +0530 Subject: [PATCH] enh --- apps/admin-ui/app/(drawer)/dashboard/index.tsx | 2 +- apps/admin-ui/eas.json | 4 ++++ apps/backend/src/stores/product-store.ts | 2 ++ apps/user-ui/components/ProductDetail.tsx | 9 +++++---- apps/user-ui/eas.json | 4 ++++ packages/db_helper_sqlite/src/user-apis/product.ts | 1 + packages/shared/types/user.ts | 1 + 7 files changed, 18 insertions(+), 5 deletions(-) diff --git a/apps/admin-ui/app/(drawer)/dashboard/index.tsx b/apps/admin-ui/app/(drawer)/dashboard/index.tsx index a3de344..c7f8d4f 100644 --- a/apps/admin-ui/app/(drawer)/dashboard/index.tsx +++ b/apps/admin-ui/app/(drawer)/dashboard/index.tsx @@ -74,7 +74,7 @@ export default function Dashboard() { const menuItems: MenuItem[] = [ { - title: 'Manage Orderss', + title: 'Manage Orders', icon: 'shopping-bag', description: 'View and manage customer orders', route: '/(drawer)/manage-orders', diff --git a/apps/admin-ui/eas.json b/apps/admin-ui/eas.json index ce4aa05..c1b701a 100755 --- a/apps/admin-ui/eas.json +++ b/apps/admin-ui/eas.json @@ -8,6 +8,10 @@ "distribution": "internal", "channel": "development" }, + "dev": { + "distribution": "internal", + "channel": "dev" + }, "preview": { "distribution": "internal", "channel": "preview" diff --git a/apps/backend/src/stores/product-store.ts b/apps/backend/src/stores/product-store.ts index 47f16b1..73f7cd4 100644 --- a/apps/backend/src/stores/product-store.ts +++ b/apps/backend/src/stores/product-store.ts @@ -19,6 +19,7 @@ import { scaffoldAssetUrl } from '@/src/lib/s3-client' // Uniform Product Type (matches getProductDetails return) interface Product { id: number + productId: number name: string shortDescription: string | null longDescription: string | null @@ -253,6 +254,7 @@ export async function getAllProducts(): Promise { products.push({ id: product.id, + productId: product.productId, name: product.name, shortDescription: product.shortDescription, longDescription: product.longDescription, diff --git a/apps/user-ui/components/ProductDetail.tsx b/apps/user-ui/components/ProductDetail.tsx index 0feed66..a4db708 100644 --- a/apps/user-ui/components/ProductDetail.tsx +++ b/apps/user-ui/components/ProductDetail.tsx @@ -166,10 +166,11 @@ const ProductDetail: React.FC = ({ productId, isFlashDeliver const loadReviews = async (reset = false) => { if (reviewsLoading || (!hasMore && !reset)) return; + if (!productDetail?.productId) return; setReviewsLoading(true); try { const { reviews: newReviews, hasMore: newHasMore } = await trpcClient.user.product.getProductReviews.query({ - productId: Number(productId), + productId: productDetail.productId, limit: 10, offset: reset ? 0 : reviewsOffset, }); @@ -195,10 +196,10 @@ const ProductDetail: React.FC = ({ productId, isFlashDeliver }; React.useEffect(() => { - if (productDetail?.id) { + if (productDetail?.productId) { loadReviews(true); } - }, [productDetail?.id]); + }, [productDetail?.productId]); // Set the store header title with product name const setStoreHeaderTitle = useStoreHeaderStore((state) => state.setTitle); @@ -477,7 +478,7 @@ const ProductDetail: React.FC = ({ productId, isFlashDeliver {/* Review Form - Moved above or keep below? Usually users want to read reviews first, but if few reviews, writing is good. The original had form then reviews. I will keep format but make it nicer. */} - + diff --git a/apps/user-ui/eas.json b/apps/user-ui/eas.json index a9e57d3..5cbedc9 100755 --- a/apps/user-ui/eas.json +++ b/apps/user-ui/eas.json @@ -13,6 +13,10 @@ "channel": "preview", "autoIncrement": true }, + "dev": { + "channel": "dev", + "autoIncrement": true + }, "production": { "autoIncrement": true, "channel": "production" diff --git a/packages/db_helper_sqlite/src/user-apis/product.ts b/packages/db_helper_sqlite/src/user-apis/product.ts index 6548d9b..7dd8935 100644 --- a/packages/db_helper_sqlite/src/user-apis/product.ts +++ b/packages/db_helper_sqlite/src/user-apis/product.ts @@ -66,6 +66,7 @@ export async function getProductDetailById(skuId: number): Promise