Tried some updates

This commit is contained in:
Henrik Larsson 2023-08-13 14:40:19 +02:00
parent 4e9323a1e0
commit d00eff7694
7 changed files with 0 additions and 12 deletions

View File

@ -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