File tree Expand file tree Collapse file tree 3 files changed +4
-10
lines changed Expand file tree Collapse file tree 3 files changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -33,16 +33,10 @@ const Produkt = ({ product }) => {
33
33
34
34
export default withRouter ( Produkt ) ;
35
35
36
- export async function getServerSideProps ( context ) {
37
- let {
38
- query : { slug, productId } ,
39
- } = context ;
40
-
41
- const id = productId ;
42
-
36
+ export async function getServerSideProps ( { query : { productId } } ) {
43
37
const res = await client . query ( {
44
38
query : GET_SINGLE_PRODUCT ,
45
- variables : { id } ,
39
+ variables : { productId } ,
46
40
} ) ;
47
41
48
42
return {
Original file line number Diff line number Diff line change 1
- import { gql } from '@apollo/client' ;
1
+ import { gql } from '@apollo/client' ;
2
2
3
3
export const ADD_TO_CART = gql `
4
4
mutation($input: AddToCartInput!) {
Original file line number Diff line number Diff line change 1
- import { gql } from '@apollo/client' ;
1
+ import { gql } from '@apollo/client' ;
2
2
3
3
export const GET_SINGLE_PRODUCT = gql `
4
4
query Product($id: ID!) {
You can’t perform that action at this time.
0 commit comments