feat: use create access token api endpoint instead of login mutation
This commit is contained in:
15
packages/web/src/hooks/useCreateAccessToken.js
Normal file
15
packages/web/src/hooks/useCreateAccessToken.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import { useMutation } from '@tanstack/react-query';
|
||||
|
||||
import api from 'helpers/api';
|
||||
|
||||
export default function useCreateAccessToken() {
|
||||
const query = useMutation({
|
||||
mutationFn: async ({ email, password }) => {
|
||||
const { data } = await api.post('/v1/access-tokens', { email, password });
|
||||
|
||||
return data;
|
||||
},
|
||||
});
|
||||
|
||||
return query;
|
||||
}
|
Reference in New Issue
Block a user