shuttlepro-shared 1.2.87 → 1.2.88

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.
@@ -188,28 +188,21 @@ const updateRoleById = async (id, updateData) => {
188
188
  }),
189
189
  };
190
190
  delete updateQuery.logs;
191
-
192
191
  const updatedRole = await Role.findByIdAndUpdate(id, updateQuery, {
193
192
  new: true,
194
193
  })
195
194
  .populate("permissionId")
196
195
  .lean()
197
196
  .exec();
198
-
199
197
  if (updatedRole) {
200
- if (updatedRole.workspaceId) {
201
- await updateCachedRoles(updatedRole.workspaceId);
202
- }
203
- // Update default roles cache if needed
204
- if (!updatedRole.workspaceId) {
205
- await updateCachedDefaultRoles();
206
- }
198
+ await updateCachedRoles(updatedRole?.workspaceId);
207
199
  }
208
-
209
200
  return updatedRole;
210
201
  };
211
202
 
212
203
  const updateRoleByFilter = async (filter, updateData) => {
204
+ console.log(filter, "filter");
205
+ console.log(updateData, "updateData");
213
206
  const updatedRole = await Role.findOneAndUpdate(filter, updateData, {
214
207
  new: true,
215
208
  })
@@ -217,15 +210,15 @@ const updateRoleByFilter = async (filter, updateData) => {
217
210
  .lean()
218
211
  .exec();
219
212
 
220
- if (updatedRole) {
221
- if (updatedRole.workspaceId) {
222
- await updateCachedRoles(updatedRole.workspaceId);
223
- }
224
- // Update default roles cache if needed
225
- if (!updatedRole.workspaceId) {
226
- await updateCachedDefaultRoles();
227
- }
228
- }
213
+ // if (updatedRole) {
214
+ // if (updatedRole.workspaceId) {
215
+ // await updateCachedRoles(updatedRole.workspaceId);
216
+ // }
217
+ // // Update default roles cache if needed
218
+ // if (!updatedRole.workspaceId) {
219
+ // await updateCachedDefaultRoles();
220
+ // }
221
+ // }
229
222
 
230
223
  return updatedRole;
231
224
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shuttlepro-shared",
3
- "version": "1.2.87",
3
+ "version": "1.2.88",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {