mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-26 06:47:17 +10:00
Add a check for empty protectedData object
This commit is contained in:
parent
ae8fbbd567
commit
44352901c3
1 changed files with 4 additions and 7 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import { isEmpty } from 'lodash';
|
||||
import { clearCurrentUser, fetchCurrentUser } from './user.duck';
|
||||
import { storableError } from '../util/errors';
|
||||
import * as log from '../util/log';
|
||||
|
|
@ -172,13 +173,9 @@ export const signup = params => (dispatch, getState, sdk) => {
|
|||
dispatch(signupRequest());
|
||||
const { email, password, firstName, lastName, ...rest } = params;
|
||||
|
||||
const createUserParams = {
|
||||
email,
|
||||
password,
|
||||
firstName,
|
||||
lastName,
|
||||
protectedData: { ...rest },
|
||||
};
|
||||
const createUserParams = isEmpty(rest)
|
||||
? { email, password, firstName, lastName }
|
||||
: { email, password, firstName, lastName, protectedData: { ...rest } };
|
||||
|
||||
// We must login the user if signup succeeds since the API doesn't
|
||||
// do that automatically.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue