1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 12:56:41 +07:00
This commit is contained in:
muerwre 2019-08-06 18:21:19 +07:00
parent 56d714d655
commit e0bba90d2e
12 changed files with 264 additions and 89 deletions

View file

@ -7,8 +7,7 @@ import {
} from '~/utils/api';
import { API } from '~/constants/api';
import { IResultWithStatus } from '~/redux/types';
import { authMeTransform, userLoginTransform } from '~/redux/auth/transforms';
import { IUser } from '~/redux/auth/types';
import { userLoginTransform } from '~/redux/auth/transforms';
export const apiUserLogin = ({
username,
@ -22,10 +21,3 @@ export const apiUserLogin = ({
.then(resultMiddleware)
.catch(errorMiddleware)
.then(userLoginTransform);
export const getAuthSelf = ({ access }): Promise<IResultWithStatus<{ user: IUser }>> =>
api
.get(API.USER.ME, configWithToken(access))
.then(resultMiddleware)
.catch(errorMiddleware)
.then(authMeTransform);