mirror of
https://github.com/r-freeman/portfolio.git
synced 2024-11-22 12:55:42 +00:00
Changed type in views component
This commit is contained in:
parent
de56c2aec7
commit
7170e786dd
@ -3,7 +3,7 @@ import {ElementType, useEffect} from 'react'
|
||||
import fetcher from '@/lib/fetcher'
|
||||
import {numberFormat} from '@/lib/numberFormat'
|
||||
|
||||
type ViewsType = {
|
||||
type ViewsResponse = {
|
||||
views: string
|
||||
}
|
||||
|
||||
@ -17,7 +17,7 @@ type ViewsProps = {
|
||||
const updateViews = (slug: string) => fetcher(`/api/views/${slug}`, {method: 'POST'})
|
||||
|
||||
export function Views({as: Component = 'span', slug, className, shouldUpdateViews = true}: ViewsProps) {
|
||||
const {data} = useSWR<ViewsType>(`/api/views/${slug}`, fetcher, {
|
||||
const {data} = useSWR<ViewsResponse>(`/api/views/${slug}`, fetcher, {
|
||||
revalidateOnFocus: false,
|
||||
revalidateOnMount: true
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user