feat(web): use REST API endpoint to register user

This commit is contained in:
Ali BARIN
2024-09-11 13:06:56 +00:00
committed by Faruk AYDIN
parent 369f04fdbc
commit ba0d46c6cd
2 changed files with 27 additions and 11 deletions

View File

@@ -0,0 +1,19 @@
import { useMutation } from '@tanstack/react-query';
import api from 'helpers/api';
export default function useRegisterUser() {
const query = useMutation({
mutationFn: async ({ fullName, email, password }) => {
const { data } = await api.post(`/v1/users/register`, {
fullName,
email,
password,
});
return data;
},
});
return query;
}