mirror of
https://github.com/vercel/commerce.git
synced 2025-05-15 05:56:59 +00:00
Tried some updates
This commit is contained in:
parent
4e9323a1e0
commit
d00eff7694
@ -1,6 +1,5 @@
|
|||||||
import {
|
import {
|
||||||
categoryQuery,
|
categoryQuery,
|
||||||
homePageQuery,
|
|
||||||
pageQuery,
|
pageQuery,
|
||||||
productQuery
|
productQuery
|
||||||
} from '@/lib/sanity/queries';
|
} from '@/lib/sanity/queries';
|
||||||
@ -8,22 +7,11 @@ import { groq } from 'next-sanity';
|
|||||||
|
|
||||||
const getQueryFromSlug = (slugArray: string[], locale: string) => {
|
const getQueryFromSlug = (slugArray: string[], locale: string) => {
|
||||||
const docQuery: { [index: string]: string } = {
|
const docQuery: { [index: string]: string } = {
|
||||||
'home': groq`${homePageQuery}`,
|
|
||||||
'product': groq`${productQuery}`,
|
'product': groq`${productQuery}`,
|
||||||
'category': groq`${categoryQuery}`,
|
'category': groq`${categoryQuery}`,
|
||||||
'page': groq`${pageQuery}`,
|
'page': groq`${pageQuery}`,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!slugArray) {
|
|
||||||
return {
|
|
||||||
docType: "home",
|
|
||||||
queryParams: {
|
|
||||||
locale: locale
|
|
||||||
},
|
|
||||||
query: docQuery.home,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let docType = ''
|
let docType = ''
|
||||||
|
|
||||||
const [slugStart] = slugArray
|
const [slugStart] = slugArray
|
||||||
|
Loading…
x
Reference in New Issue
Block a user