Skip to content

Commit

Permalink
fix issue on product id route (#41)
Browse files Browse the repository at this point in the history
Co-authored-by: Stephanie Dietz <[email protected]>
  • Loading branch information
trace2798 and StephDietz authored Nov 27, 2024
1 parent f776b3b commit ece8a1c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

# production
/build

.env
# misc
.DS_Store
*.pem
Expand Down
3 changes: 2 additions & 1 deletion frontend/app/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
`;
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/components/product-details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<div className="rounded-lg bg-black border border-stone-700 p-6 w-full h-full flex flex-col md:flex-row">
Expand Down

0 comments on commit ece8a1c

Please sign in to comment.