adding user hooks to replace api

This commit is contained in:
Elijah Lucian
2021-07-12 21:43:21 -06:00
parent 5e5c539ee7
commit 1af8209b99
11 changed files with 97 additions and 34 deletions
@@ -0,0 +1,9 @@
import { useAppContext } from '../../contexts/AppContext'
import { User } from '../../types'
export const useUpdateUser = () => {
const api = useAppContext()
return (id: string, body: Partial<User>): Promise<User> =>
api.patch<User>(`/users/${id}`, body)
}