Projekt

Obecné

Profil

Stáhnout (623 Bajtů) Statistiky
| Větev: | Tag: | Revize:
1
import { axiosInstance } from "./api"
2
import {Toast} from "native-base"
3

    
4
export const loginRequest = async (username: string, password: string) => {
5
    return await axiosInstance.post(
6
        "/login",
7
        {
8
            username: username,
9
            password: password
10
        }
11
    )
12
}
13

    
14
export const isAuthRequest = async () => {
15
    Toast.show({
16
        title: `Checking auth ${axiosInstance.defaults.baseURL}`,
17
        duration: 10000
18
    })
19
    return await axiosInstance.get(
20
        "/isauth"
21
    )
22
}
23

    
24
export const logoutRequest = async () => {
25
    return await axiosInstance.get(
26
        "/logout"
27
    )
28
}
29

    
30

    
(2-2/8)