forked from polka_billy/porridger
17 lines
507 B
TypeScript
17 lines
507 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
|
|
)
|
|
)
|
|
|
|
export default useUserRating
|