Skip to content

Commit

Permalink
Destructure inside of function
Browse files Browse the repository at this point in the history
  • Loading branch information
w3bdesign committed Jul 25, 2020
1 parent 8cbc925 commit 3c3d60c
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions pages/produkt/[slug].js
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,10 @@ const Produkt = ({ product }) => {

export default withRouter(Produkt);

export async function getServerSideProps(context) {
let {
query: { slug, productId },
} = context;

const id = productId;

export async function getServerSideProps({ query: { productId } }) {
const res = await client.query({
query: GET_SINGLE_PRODUCT,
variables: { id },
variables: { productId },
});

return {
Expand Down

0 comments on commit 3c3d60c

Please sign in to comment.