shuttlepro-shared 1.2.30 → 1.2.31
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.
|
@@ -120,12 +120,21 @@ const deleteUserRole = async (id) => {
|
|
|
120
120
|
|
|
121
121
|
const findUserWorkspaces = async (userId) => {
|
|
122
122
|
const cacheKey = `${CACHE_KEY_USER_WORKSPACE_PREFIX}${userId}`;
|
|
123
|
+
console.log(cacheKey, "cacheKey");
|
|
123
124
|
let userRoleWithWorkspaces = await getRedisData(cacheKey);
|
|
124
125
|
|
|
126
|
+
console.log(userRoleWithWorkspaces, "userRoleWithWorkspaces");
|
|
127
|
+
|
|
125
128
|
if (!userRoleWithWorkspaces) {
|
|
126
129
|
userRoleWithWorkspaces = await UserRole.find({
|
|
127
130
|
userId: userId,
|
|
128
131
|
})
|
|
132
|
+
.select("userId roleId workspaceId")
|
|
133
|
+
.populate({
|
|
134
|
+
path: "roleId",
|
|
135
|
+
select: "id name userId userShift permissionId modulePermissions",
|
|
136
|
+
populate: [{ path: "permissionId", select: "id name" }],
|
|
137
|
+
})
|
|
129
138
|
.populate({
|
|
130
139
|
path: "workspaceId",
|
|
131
140
|
select: defaultSelect,
|
|
@@ -133,7 +142,7 @@ const findUserWorkspaces = async (userId) => {
|
|
|
133
142
|
})
|
|
134
143
|
.lean()
|
|
135
144
|
.exec();
|
|
136
|
-
|
|
145
|
+
console.log(userRoleWithWorkspaces, "userRoleWithWorkspaces");
|
|
137
146
|
if (userRoleWithWorkspaces) {
|
|
138
147
|
await addDataToRedisSet(cacheKey, userRoleWithWorkspaces);
|
|
139
148
|
}
|