Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix issue on product id route #41

Merged
merged 2 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading