Shopify Provier Updates (#212)

* changes

* Adding shopify commit

* Changed to query page by id

* Fixed page query, Changed use-search GraphQl query

* Update use-search.tsx

* remove unused util

* Changed cookie expiration

* Update tsconfig.json

Co-authored-by: okbel <curciobel@gmail.com>
This commit is contained in:
cond0r
2021-03-01 16:47:30 +02:00
committed by GitHub
parent 751011767a
commit 641ce0aa64
18 changed files with 164 additions and 175 deletions

View File

@@ -2,9 +2,9 @@ import getSortVariables from './get-sort-variables'
import type { SearchProductsInput } from '../product/use-search'
export const getSearchVariables = ({
categoryId,
brandId,
search,
categoryId,
sort,
}: SearchProductsInput) => {
let query = ''
@@ -13,17 +13,14 @@ export const getSearchVariables = ({
query += `product_type:${search} OR title:${search} OR tag:${search}`
}
if (categoryId) {
query += `tag:${categoryId}`
}
if (brandId) {
query += `${categoryId ? ' AND ' : ''}vendor:${brandId}`
query += `${search ? ' AND ' : ''}vendor:${brandId}`
}
return {
categoryId,
query,
...getSortVariables(sort),
...getSortVariables(sort, !!categoryId),
}
}