mirror of
https://github.com/umami-software/umami.git
synced 2026-02-13 17:15:37 +01:00
Added teams pages. Refactored hooks.
This commit is contained in:
parent
a2c202fa36
commit
9448aa3ab5
136 changed files with 387 additions and 287 deletions
|
|
@ -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');
|
||||
},
|
||||
});
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue