File size: 439 Bytes
41a71fd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import { $api } from '@/shared/api/axiosInstance';
import { UserType } from '@/entities/User';
import { AuthByEmailType } from '../ui/AuthByEmail/AuthByEmail';

type LoginProps = AuthByEmailType;
type LoginResponse = {
    status: number;
    user: UserType;
    token: string;
};

export const signInByEmail = async (authData: LoginProps) => {
    const { data } = await $api.post<LoginResponse>(`/login`, authData);

    return data;
};