adding user hooks to replace api
This commit is contained in:
@@ -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)
|
||||
}
|
||||
Reference in New Issue
Block a user