@frontegg/redux-store 7.100.0-alpha.2 → 7.100.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/auth/ProfileState/actions.js +8 -9
- package/index.js +1 -1
- package/node/auth/ProfileState/actions.js +8 -9
- package/node/index.js +1 -1
- package/package.json +2 -2
|
@@ -16,10 +16,9 @@ export default ((store, api, sharedActions) => {
|
|
|
16
16
|
loading: true
|
|
17
17
|
});
|
|
18
18
|
try {
|
|
19
|
-
const profile = await retry(api.
|
|
19
|
+
const profile = await retry(api.teams.getProfile, 3, 2000);
|
|
20
20
|
const currentUser = store.auth.user;
|
|
21
|
-
|
|
22
|
-
actions.setUser(mergedUser);
|
|
21
|
+
actions.setUser(_extends({}, currentUser, profile));
|
|
23
22
|
setProfileState({
|
|
24
23
|
profile,
|
|
25
24
|
loading: false
|
|
@@ -118,17 +117,17 @@ export default ((store, api, sharedActions) => {
|
|
|
118
117
|
const newProfileData = _extends({}, oldProfileData, payload, {
|
|
119
118
|
profilePictureUrl: newProfilePictureUrl
|
|
120
119
|
});
|
|
121
|
-
|
|
120
|
+
|
|
121
|
+
//TODO: change the payload type to IUpdateUserProfile which is the right type to send, currently we send more data then actually needed.
|
|
122
|
+
const profile = await api.users.updateUserProfileV2(newProfileData);
|
|
122
123
|
const currentUser = store.auth.user;
|
|
123
|
-
|
|
124
|
-
const mergedUser = _extends({}, currentUser, completeUserData);
|
|
125
|
-
actions.setUser(mergedUser);
|
|
124
|
+
actions.setUser(_extends({}, currentUser, profile));
|
|
126
125
|
actions.setProfileState({
|
|
127
|
-
profile
|
|
126
|
+
profile,
|
|
128
127
|
saving: false,
|
|
129
128
|
loading: false
|
|
130
129
|
});
|
|
131
|
-
callback == null ? void 0 : callback(
|
|
130
|
+
callback == null ? void 0 : callback(newProfileData);
|
|
132
131
|
} catch (e) {
|
|
133
132
|
setProfileState({
|
|
134
133
|
saving: false,
|
package/index.js
CHANGED
|
@@ -23,10 +23,9 @@ var _default = (store, api, sharedActions) => {
|
|
|
23
23
|
loading: true
|
|
24
24
|
});
|
|
25
25
|
try {
|
|
26
|
-
const profile = await (0, _helpers.retry)(api.
|
|
26
|
+
const profile = await (0, _helpers.retry)(api.teams.getProfile, 3, 2000);
|
|
27
27
|
const currentUser = store.auth.user;
|
|
28
|
-
|
|
29
|
-
actions.setUser(mergedUser);
|
|
28
|
+
actions.setUser((0, _extends2.default)({}, currentUser, profile));
|
|
30
29
|
setProfileState({
|
|
31
30
|
profile,
|
|
32
31
|
loading: false
|
|
@@ -125,17 +124,17 @@ var _default = (store, api, sharedActions) => {
|
|
|
125
124
|
const newProfileData = (0, _extends2.default)({}, oldProfileData, payload, {
|
|
126
125
|
profilePictureUrl: newProfilePictureUrl
|
|
127
126
|
});
|
|
128
|
-
|
|
127
|
+
|
|
128
|
+
//TODO: change the payload type to IUpdateUserProfile which is the right type to send, currently we send more data then actually needed.
|
|
129
|
+
const profile = await api.users.updateUserProfileV2(newProfileData);
|
|
129
130
|
const currentUser = store.auth.user;
|
|
130
|
-
|
|
131
|
-
const mergedUser = (0, _extends2.default)({}, currentUser, completeUserData);
|
|
132
|
-
actions.setUser(mergedUser);
|
|
131
|
+
actions.setUser((0, _extends2.default)({}, currentUser, profile));
|
|
133
132
|
actions.setProfileState({
|
|
134
|
-
profile
|
|
133
|
+
profile,
|
|
135
134
|
saving: false,
|
|
136
135
|
loading: false
|
|
137
136
|
});
|
|
138
|
-
callback == null ? void 0 : callback(
|
|
137
|
+
callback == null ? void 0 : callback(newProfileData);
|
|
139
138
|
} catch (e) {
|
|
140
139
|
setProfileState({
|
|
141
140
|
saving: false,
|
package/node/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontegg/redux-store",
|
|
3
|
-
"version": "7.100.0-alpha.
|
|
3
|
+
"version": "7.100.0-alpha.3",
|
|
4
4
|
"main": "./node/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Frontegg LTD",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@babel/runtime": "^7.18.6",
|
|
9
9
|
"@frontegg/entitlements-javascript-commons": "1.1.2",
|
|
10
|
-
"@frontegg/rest-api": "7.100.0-alpha.
|
|
10
|
+
"@frontegg/rest-api": "7.100.0-alpha.3",
|
|
11
11
|
"fast-deep-equal": "3.1.3",
|
|
12
12
|
"get-value": "^3.0.1",
|
|
13
13
|
"proxy-compare": "^3.0.0",
|