@autofleet/zehut 1.7.3-beta1 → 1.7.3-beta2
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/lib/user/ApiUser.js +4 -0
- package/package.json +1 -1
package/lib/user/ApiUser.js
CHANGED
|
@@ -96,14 +96,17 @@ class ApiUser {
|
|
|
96
96
|
}
|
|
97
97
|
getUserAppPermissions(appId) {
|
|
98
98
|
return __awaiter(this, void 0, void 0, function* () {
|
|
99
|
+
console.log('getUserAppPermissions1', appId, this.id);
|
|
99
100
|
if (!this.id || appId) {
|
|
100
101
|
return;
|
|
101
102
|
}
|
|
102
103
|
const currentAppPermission = this.appPermission[appId];
|
|
104
|
+
console.log('getUserAppPermissions2', currentAppPermission);
|
|
103
105
|
if (currentAppPermission) {
|
|
104
106
|
return currentAppPermission;
|
|
105
107
|
}
|
|
106
108
|
const cachedResult = userCache.get(`${this.id}:${appId}`);
|
|
109
|
+
console.log('getUserAppPermissions3', cachedResult);
|
|
107
110
|
if (cachedResult) {
|
|
108
111
|
this.appPermission[appId] = cachedResult;
|
|
109
112
|
return cachedResult;
|
|
@@ -111,6 +114,7 @@ class ApiUser {
|
|
|
111
114
|
const { data } = yield services_1.AutofleetApiNetwork.post(`/api/v1/apps/${appId}/get-user-payload`, {
|
|
112
115
|
userId: this.id,
|
|
113
116
|
});
|
|
117
|
+
console.log('getUserAppPermissions4', data);
|
|
114
118
|
userCache.set(this.id, data);
|
|
115
119
|
this.appPermission[appId] = data;
|
|
116
120
|
return this.appPermission[appId];
|