porridger/front/src/hooks/api/useUserRating.ts

31 lines
776 B
TypeScript

import { composeUserRatingURL, initialUserRating, processUserRating } from '../../api/userRating'
import { UserRating, isUserRatingResponse } from '../../api/userRating/types'
import useFetch, { UseFetchReturn } from '../useFetch'
const useUserRating = (userId: number): UseFetchReturn<UserRating> => (
// useFetch(
// composeUserRatingURL(userId),
// 'GET',
// false,
// isUserRatingResponse,
// processUserRating,
// initialUserRating
// )
{
data: 3,
loading: false,
error: null,
refetch: () => { return },
}
// {
// data: undefined,
// loading: true,
// error: null,
// refetch: () => { return },
// }
)
export default useUserRating