Skip to content

Commit

Permalink
fix: build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
CaliCastle committed Mar 13, 2024
1 parent 6fbb741 commit 941050f
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions sanity/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@ export const getAllLatestBlogPostSlugsQuery = () =>
&& defined(slug.current)] | order(publishedAt desc).slug.current
`

export const getAllLatestBlogPostSlugs = () => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
return clientFetch<string[]>(getAllLatestBlogPostSlugsQuery())
export const getAllLatestBlogPostSlugs = (): Promise<string[]> => {
return clientFetch(getAllLatestBlogPostSlugsQuery())
}

type GetBlogPostsOptions = {
Expand Down Expand Up @@ -49,10 +47,9 @@ export const getLatestBlogPostsQuery = ({
}
}
}`
export const getLatestBlogPosts = (options: GetBlogPostsOptions) =>
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
clientFetch<Post[] | null>(getLatestBlogPostsQuery(options))
export const getLatestBlogPosts = (
options: GetBlogPostsOptions
): Promise<Post[] | null> => clientFetch(getLatestBlogPostsQuery(options))

export const getBlogPostQuery = groq`
*[_type == "post" && slug.current == $slug && !(_id in path("drafts.**"))][0] {
Expand Down Expand Up @@ -98,10 +95,8 @@ export const getBlogPostQuery = groq`
},
}
}`
export const getBlogPost = (slug: string) =>
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
clientFetch<PostDetail | undefined>(getBlogPostQuery, { slug })
export const getBlogPost = (slug: string): Promise<PostDetail | undefined> =>
clientFetch(getBlogPostQuery, { slug })

export const getSettingsQuery = () =>
groq`
Expand Down

0 comments on commit 941050f

Please sign in to comment.