import { request } from '../../../utils';
import { API } from '../../../types';

export enum ResultTypes {
  ERROR = 'ERROR',
  OK = 'OK'
}

export type PostLoginUserReturn = {
  token: string;
  status?: string;
  result: ResultTypes;
  result_description?: string;
};

export const authApi = {
  loginUser: (data: { login: string; pass: string }) =>
    request.postForm<PostLoginUserReturn>(API.LOGIN, data)
};
