Fixed useFetch and useUser typing

This commit is contained in:
2023-07-20 00:55:12 +03:00
parent 7a044970f0
commit bc154f8b6b
3 changed files with 16 additions and 22 deletions

View File

@@ -1,8 +1,8 @@
import { initialUser } from '../../api/user'
import { User } from '../../api/user/types'
import { UseFetchErrored, UseFetchSucced } from '../useFetch'
import { UseFetchReturn } from '../useFetch'
const useUser = (): UseFetchSucced<User> | UseFetchErrored => (
const useUser = (): UseFetchReturn<User> => (
// useFetch(
// composeUserUrl(getToken()),
// 'GET',
@@ -16,6 +16,7 @@ const useUser = (): UseFetchSucced<User> | UseFetchErrored => (
data: initialUser,
loading: false,
error: null,
setData: () => {0}
}
)