1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-26 05:16:41 +07:00

added initial profile dialog

This commit is contained in:
Fedor Katurov 2019-11-11 16:01:21 +07:00
parent f6baedc4cd
commit 618c2e3275
28 changed files with 315 additions and 58 deletions

View file

@ -14,23 +14,32 @@ const setLoginError: ActionHandler<typeof ActionCreators.userSetLoginError> = (
login: {
...state.login,
error,
}
},
});
const setUser: ActionHandler<typeof ActionCreators.authSetUser> = (state, { profile }) => ({
...state,
user: {
...state.user,
...profile
}
...profile,
},
});
const setToken: ActionHandler<typeof ActionCreators.authSetToken> = (state, { token }) => ({
...state, token,
...state,
token,
});
const setProfile: ActionHandler<typeof ActionCreators.authSetProfile> = (state, { profile }) => ({
...state,
profile: {
...state.profile,
...profile,
},
});
export const AUTH_USER_HANDLERS = {
[AUTH_USER_ACTIONS.SET_LOGIN_ERROR]: setLoginError,
[AUTH_USER_ACTIONS.SET_USER]: setUser,
[AUTH_USER_ACTIONS.SET_TOKEN]: setToken,
[AUTH_USER_ACTIONS.SET_PROFILE]: setProfile,
};