Files
mixtape/zero.Backoffice.UI/app/account/api.ts
T

13 lines
748 B
TypeScript
Raw Normal View History

2021-12-14 11:54:36 +01:00
import { AccountLoggedInResponse, AccountLoginModel, AccountLoginResponse, AccountUser } from 'zero/account';
import { get, post, ApiRequestConfig, ApiResponse } from '../services/request';
2021-12-09 14:18:38 +01:00
export default {
2021-12-14 12:16:27 +01:00
getUser: (config?: ApiRequestConfig): Promise<ApiResponse<AccountUser>> => get('backoffice/account/user', { ...config }),
2021-12-09 14:18:38 +01:00
2021-12-14 12:16:27 +01:00
isAuthenticated: (config?: ApiRequestConfig): Promise<ApiResponse<AccountLoggedInResponse>> => get('backoffice/account/loggedin', { ...config }),
2021-12-09 14:18:38 +01:00
2021-12-14 12:16:27 +01:00
login: (model: AccountLoginModel, config?: ApiRequestConfig): Promise<ApiResponse<AccountLoginResponse>> => post('backoffice/account/login', model, { ...config }),
2021-12-09 14:18:38 +01:00
2021-12-14 12:16:27 +01:00
logout: (config?: ApiRequestConfig) => post('backoffice/account/logout', null, { ...config })
2021-12-09 14:18:38 +01:00
};