Created
May 23, 2023 01:49
-
-
Save dineshigdd/b48c90049cf77f99e2f79df4a26cf75e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const AddUser = useMutation({ | |
mutationFn: ( user ) => { | |
return fetch('https://jsonplaceholder.typicode.com/users', | |
{ | |
method:'post', | |
headers: { | |
"Content-Type": "application/json", | |
}, | |
body:JSON.stringify( user ) | |
}).then( res => res.json() ) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment