# All files / src/login post.ts

82.35% Statements 14/17
100% Branches 2/2
50% Functions 2/4
82.35% Lines 14/17

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    181x
    1x
    1x
    1x
    2x
    2x
    2x
    2x
    2x
    2x
    2x
    2x
    1x
    1x

     import { Login } from '../interfaces/login';
    import { handleRequest, ApiRequestParams } from '../API';

    export const login = async (
      username: string,
      password: string,
    ): Promise<Login> => {
      const options: ApiRequestParams = {
        data: { login: username, password },
      };
      return handleRequest('post', '/@login', options);
    };

    export const loginQuery = (username: string, password: string) => ({
      queryKey: [username, password, 'login'],
      queryFn: async () => login(username, password),
    });