Skip to content

Commit 8af00ce

Browse files
authored
Merge pull request #289 from w3bdesign/develop
Fix Algolia and cart update functionality
2 parents 81775b4 + ea006c9 commit 8af00ce

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

components/AlgoliaSearch/SearchResults.component.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const SearchResults = ({
3030
<article className="cursor-pointer hit">
3131
<Link
3232
href="/produkt/[post]"
33-
as={`/produkt/${trimmedProductName}?productId=${objectID}`}
33+
as={`/produkt/${trimmedProductName}?id=${objectID}`}
3434
>
3535
<div className="flex p-6 bg-white">
3636
<header className="hit-image-container">

components/Product/IndexProducts.component.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const IndexProducts = ({ products }) => {
3030
key={uuidv4()}
3131
className="flex flex-col p-6 md:w-1/2 xl:w-1/4"
3232
>
33-
<Link href="/produkt/[post]" as={`/produkt/${slug}?id=${id}`}>
33+
<Link href="/produkt/[post]" as={`/produkt/${slug}?id=${databaseId}`}>
3434
<a>
3535
{image ? (
3636
<img
@@ -49,7 +49,7 @@ const IndexProducts = ({ products }) => {
4949
)}
5050
</a>
5151
</Link>
52-
<Link href="/produkt/[post]" as={`/produkt/${slug}?id=${id}`}>
52+
<Link href="/produkt/[post]" as={`/produkt/${slug}?id=${databaseId}`}>
5353
<a>
5454
<div className="flex justify-center pt-3">
5555
<p className="font-bold text-center cursor-pointer">

utils/gql/GQL_MUTATIONS.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export const UPDATE_CART = gql`
8888
key
8989
product {
9090
id
91-
productId
91+
databaseId
9292
name
9393
description
9494
type
@@ -111,7 +111,7 @@ export const UPDATE_CART = gql`
111111
}
112112
variation {
113113
id
114-
variationId
114+
databaseId
115115
name
116116
description
117117
type
@@ -142,22 +142,22 @@ export const UPDATE_CART = gql`
142142
key
143143
product {
144144
id
145-
productId
145+
databaseId
146146
}
147147
variation {
148148
id
149-
variationId
149+
databaseId
150150
}
151151
}
152152
updated {
153153
key
154154
product {
155155
id
156-
productId
156+
databaseId
157157
}
158158
variation {
159159
id
160-
variationId
160+
databaseId
161161
}
162162
}
163163
}

utils/gql/GQL_QUERIES.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { gql } from '@apollo/client';
22

33
export const GET_SINGLE_PRODUCT = gql`
44
query Product($id: ID!) {
5-
product(id: $id) {
5+
product(id: $id, idType: DATABASE_ID) {
66
id
77
databaseId
88
averageRating

0 commit comments

Comments
 (0)