Skip to content

Commit 3c3d60c

Browse files
committed
Destructure inside of function
1 parent 8cbc925 commit 3c3d60c

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

pages/produkt/[slug].js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,10 @@ const Produkt = ({ product }) => {
3333

3434
export default withRouter(Produkt);
3535

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 } }) {
4337
const res = await client.query({
4438
query: GET_SINGLE_PRODUCT,
45-
variables: { id },
39+
variables: { productId },
4640
});
4741

4842
return {

0 commit comments

Comments
 (0)