shuttlepro-shared 1.2.89 → 1.2.91

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.
@@ -88,7 +88,7 @@ const findOneAndUpdateUserRole = async (filter, payload) => {
88
88
  )
89
89
  .lean()
90
90
  .exec();
91
- return await updateCachedMembers(workspaceId);
91
+ return await updateCachedMembers(filter.workspaceId);
92
92
  };
93
93
 
94
94
  const updateUserRole = async (filter, payload) => {
@@ -96,6 +96,12 @@ const updateUserRole = async (filter, payload) => {
96
96
  return await updateCachedMembers(filter.workspaceId);
97
97
  };
98
98
 
99
+ // Update multiple user roles based on filter
100
+ const updateManyUserRoles = async (filter, payload) => {
101
+ await UserRole.updateMany(filter, { $set: payload }).exec();
102
+ return await updateCachedMembers(filter.workspaceId);
103
+ };
104
+
99
105
  const deleteUserRoleByFilter = async (filter) => {
100
106
  await UserRole.deleteOne(filter).exec();
101
107
  return await updateCachedMembers(filter.workspaceId);
@@ -216,6 +222,7 @@ const findUserWorkspaces = async (userId) => {
216
222
  module.exports = {
217
223
  createUserRole,
218
224
  updateUserRole,
225
+ updateManyUserRoles,
219
226
  findAllUserRoles,
220
227
  deleteUserRoleByFilter,
221
228
  findUserWorkspaces,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shuttlepro-shared",
3
- "version": "1.2.89",
3
+ "version": "1.2.91",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {