Added teams pages. Refactored hooks.
This commit is contained in:
@@ -10,10 +10,9 @@ import {
|
||||
Icon,
|
||||
} from 'react-basics';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import useApi from 'components/hooks/useApi';
|
||||
import { useApi, useMessages } from 'components/hooks';
|
||||
import { setUser } from 'store/app';
|
||||
import { setClientAuthToken } from 'lib/client';
|
||||
import useMessages from 'components/hooks/useMessages';
|
||||
import Logo from 'assets/logo.svg';
|
||||
import styles from './LoginForm.module.css';
|
||||
|
||||
@@ -25,13 +24,13 @@ export function LoginForm() {
|
||||
mutationFn: (data: any) => post('/auth/login', data),
|
||||
});
|
||||
|
||||
const handleSubmit = async data => {
|
||||
const handleSubmit = async (data: any) => {
|
||||
mutate(data, {
|
||||
onSuccess: async ({ token, user }) => {
|
||||
setClientAuthToken(token);
|
||||
setUser(user);
|
||||
|
||||
await router.push('/dashboard');
|
||||
router.push('/dashboard');
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user