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 {
|
||||
categoryQuery,
|
||||
homePageQuery,
|
||||
pageQuery,
|
||||
productQuery
|
||||
} from '@/lib/sanity/queries';
|
||||
@ -8,22 +7,11 @@ import { groq } from 'next-sanity';
|
||||
|
||||
const getQueryFromSlug = (slugArray: string[], locale: string) => {
|
||||
const docQuery: { [index: string]: string } = {
|
||||
'home': groq`${homePageQuery}`,
|
||||
'product': groq`${productQuery}`,
|
||||
'category': groq`${categoryQuery}`,
|
||||
'page': groq`${pageQuery}`,
|
||||
}
|
||||
|
||||
if (!slugArray) {
|
||||
return {
|
||||
docType: "home",
|
||||
queryParams: {
|
||||
locale: locale
|
||||
},
|
||||
query: docQuery.home,
|
||||
}
|
||||
}
|
||||
|
||||
let docType = ''
|
||||
|
||||
const [slugStart] = slugArray
|
||||
|
Loading…
x
Reference in New Issue
Block a user