diff options
Diffstat (limited to 'src/utils/hooks')
| -rw-r--r-- | src/utils/hooks/use-article.ts (renamed from src/utils/hooks/use-article.tsx) | 5 | ||||
| -rw-r--r-- | src/utils/hooks/use-comments.ts (renamed from src/utils/hooks/use-comments.tsx) | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/utils/hooks/use-article.tsx b/src/utils/hooks/use-article.ts index 86d8e38..5cf0e51 100644 --- a/src/utils/hooks/use-article.tsx +++ b/src/utils/hooks/use-article.ts @@ -4,7 +4,7 @@ import { fetchAPI, getArticleFromRawData, } from '../../services/graphql'; -import { type Article, type RawArticle } from '../../types'; +import type { Article, RawArticle } from '../../types'; export type UseArticleConfig = { /** @@ -29,7 +29,8 @@ export const useArticle = ({ }: UseArticleConfig): Article | undefined => { const { data } = useSWR( slug ? { query: articleBySlugQuery, variables: { slug } } : null, - fetchAPI<RawArticle, typeof articleBySlugQuery> + fetchAPI<RawArticle, typeof articleBySlugQuery>, + {} ); return data ? getArticleFromRawData(data.post) : fallback; diff --git a/src/utils/hooks/use-comments.tsx b/src/utils/hooks/use-comments.ts index 6ac3d42..ac723e9 100644 --- a/src/utils/hooks/use-comments.tsx +++ b/src/utils/hooks/use-comments.ts @@ -1,6 +1,6 @@ import useSWR from 'swr'; import { getAllComments } from '../../services/graphql'; -import { SingleComment } from '../../types'; +import type { SingleComment } from '../../types'; export type UseCommentsConfig = { contentId?: string | number; @@ -17,7 +17,7 @@ export const useComments = ({ contentId, fallback, }: UseCommentsConfig): SingleComment[] | undefined => { - const { data } = useSWR(contentId ? { contentId } : null, getAllComments); + const { data } = useSWR(contentId ? { contentId } : null, getAllComments, {}); return data ?? fallback; }; |
