shuttlepro-shared 1.2.59 → 1.2.60

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.
@@ -171,15 +171,17 @@ const findUserWorkspaces = async (userId) => {
171
171
  })
172
172
  .lean()
173
173
  .exec();
174
- userRoleWithWorkspaces = userRoleWithWorkspaces.map((ur) => {
175
- return {
176
- ...ur?.workspaceId,
177
- id: ur?.workspaceId?._id?.toString(),
178
- _id: ur?.workspaceId?._id?.toString(),
179
- role: ur?.roleId?.name || "",
180
- permissions: ur?.roleId?.modulePermissions?.modules || [],
181
- };
182
- });
174
+ userRoleWithWorkspaces = userRoleWithWorkspaces
175
+ ?.filter((userRole) => userRole?.workspaceId)
176
+ ?.map((ur) => {
177
+ return {
178
+ ...ur?.workspaceId,
179
+ id: ur?.workspaceId?._id?.toString(),
180
+ _id: ur?.workspaceId?._id?.toString(),
181
+ role: ur?.roleId?.name || "",
182
+ permissions: ur?.roleId?.modulePermissions?.modules || [],
183
+ };
184
+ });
183
185
  if (userRoleWithWorkspaces) {
184
186
  await setRedisData(cacheKey, userRoleWithWorkspaces, null, 0);
185
187
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shuttlepro-shared",
3
- "version": "1.2.59",
3
+ "version": "1.2.60",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {