From 71743d5ce0c58d591e0855cb7089ccd2c4df7c92 Mon Sep 17 00:00:00 2001 From: trace2798 <113078518+trace2798@users.noreply.github.com> Date: Wed, 27 Nov 2024 00:38:19 +0530 Subject: [PATCH] fix issue on product id route --- frontend/.gitignore | 2 +- frontend/app/actions.ts | 3 ++- frontend/app/components/product-details.tsx | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/.gitignore b/frontend/.gitignore index fd3dbb5..c275c4f 100644 --- a/frontend/.gitignore +++ b/frontend/.gitignore @@ -15,7 +15,7 @@ # production /build - +.env # misc .DS_Store *.pem diff --git a/frontend/app/actions.ts b/frontend/app/actions.ts index 67b6a3b..10f9af9 100644 --- a/frontend/app/actions.ts +++ b/frontend/app/actions.ts @@ -80,12 +80,13 @@ query searchProducts($query: String!, $maxItems: Int!, $thresholdStars: Float!, export async function getProduct(id: string) { const graphqlQuery = ` query getProduct($id: String!) { - getProduct(id: $id) { + product(id: $id) { name description stars price image + isStocked } } `; diff --git a/frontend/app/components/product-details.tsx b/frontend/app/components/product-details.tsx index a97e3df..ed829e4 100644 --- a/frontend/app/components/product-details.tsx +++ b/frontend/app/components/product-details.tsx @@ -5,7 +5,7 @@ import { SubmitButton } from "./submit-button"; export async function ProductDetails({ id }: { id: string }) { const response = await getProduct(id); - const product = response?.data?.getProduct; + const product = response?.data?.product; return (