10 lines
267 B
TypeScript
10 lines
267 B
TypeScript
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)
|
|
}
|