mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-26 05:16:41 +07:00
added register_socials to reducer
This commit is contained in:
parent
358b197c19
commit
837b4ee6f3
8 changed files with 1471 additions and 1412 deletions
|
@ -64,6 +64,7 @@ const setRestore: ActionHandler<typeof ActionCreators.authSetRestore> = (state,
|
|||
...restore,
|
||||
},
|
||||
});
|
||||
|
||||
const setSocials: ActionHandler<typeof ActionCreators.authSetSocials> = (state, { socials }) => ({
|
||||
...state,
|
||||
profile: {
|
||||
|
@ -75,6 +76,31 @@ const setSocials: ActionHandler<typeof ActionCreators.authSetSocials> = (state,
|
|||
},
|
||||
});
|
||||
|
||||
const setRegisterSocial: ActionHandler<typeof ActionCreators.authSetRegisterSocial> = (
|
||||
state,
|
||||
{ register_social }
|
||||
) => ({
|
||||
...state,
|
||||
register_social: {
|
||||
...state.register_social,
|
||||
...register_social,
|
||||
},
|
||||
});
|
||||
|
||||
const setRegisterSocialErrors: ActionHandler<typeof ActionCreators.authSetRegisterSocialErrors> = (
|
||||
state,
|
||||
{ errors }
|
||||
) => ({
|
||||
...state,
|
||||
register_social: {
|
||||
...state.register_social,
|
||||
errors: {
|
||||
...state.register_social.errors,
|
||||
...errors,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export const AUTH_USER_HANDLERS = {
|
||||
[AUTH_USER_ACTIONS.SET_LOGIN_ERROR]: setLoginError,
|
||||
[AUTH_USER_ACTIONS.SET_USER]: setUser,
|
||||
|
@ -84,4 +110,6 @@ export const AUTH_USER_HANDLERS = {
|
|||
[AUTH_USER_ACTIONS.SET_LAST_SEEN_MESSAGES]: setLastSeenMessages,
|
||||
[AUTH_USER_ACTIONS.SET_RESTORE]: setRestore,
|
||||
[AUTH_USER_ACTIONS.SET_SOCIALS]: setSocials,
|
||||
[AUTH_USER_ACTIONS.SET_REGISTER_SOCIAL]: setRegisterSocial,
|
||||
[AUTH_USER_ACTIONS.SET_REGISTER_SOCIAL_ERRORS]: setRegisterSocialErrors,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue