@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.
@@ -16,10 +16,9 @@ export default ((store, api, sharedActions) => {
16
16
  loading: true
17
17
  });
18
18
  try {
19
- const profile = await retry(api.auth.getMeAndEntitlements, 3, 2000);
19
+ const profile = await retry(api.teams.getProfile, 3, 2000);
20
20
  const currentUser = store.auth.user;
21
- const mergedUser = _extends({}, currentUser, profile);
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
- await api.users.updateUserProfileV2(newProfileData);
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
- const completeUserData = await retry(api.auth.getMeAndEntitlements, 3, 2000);
124
- const mergedUser = _extends({}, currentUser, completeUserData);
125
- actions.setUser(mergedUser);
124
+ actions.setUser(_extends({}, currentUser, profile));
126
125
  actions.setProfileState({
127
- profile: completeUserData,
126
+ profile,
128
127
  saving: false,
129
128
  loading: false
130
129
  });
131
- callback == null ? void 0 : callback(completeUserData);
130
+ callback == null ? void 0 : callback(newProfileData);
132
131
  } catch (e) {
133
132
  setProfileState({
134
133
  saving: false,
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v7.100.0-alpha.2
1
+ /** @license Frontegg v7.100.0-alpha.3
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -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.auth.getMeAndEntitlements, 3, 2000);
26
+ const profile = await (0, _helpers.retry)(api.teams.getProfile, 3, 2000);
27
27
  const currentUser = store.auth.user;
28
- const mergedUser = (0, _extends2.default)({}, currentUser, profile);
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
- await api.users.updateUserProfileV2(newProfileData);
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
- const completeUserData = await (0, _helpers.retry)(api.auth.getMeAndEntitlements, 3, 2000);
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: completeUserData,
133
+ profile,
135
134
  saving: false,
136
135
  loading: false
137
136
  });
138
- callback == null ? void 0 : callback(completeUserData);
137
+ callback == null ? void 0 : callback(newProfileData);
139
138
  } catch (e) {
140
139
  setProfileState({
141
140
  saving: false,
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v7.100.0-alpha.2
1
+ /** @license Frontegg v7.100.0-alpha.3
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@frontegg/redux-store",
3
- "version": "7.100.0-alpha.2",
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.2",
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",