shuttlepro-shared 1.2.80 → 1.2.82
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.
|
@@ -71,8 +71,8 @@ const findSingleUserRoleByFilter = async ({ workspaceId, userId }) => {
|
|
|
71
71
|
return await getMemberByWorkspaceIdAndUserId(workspaceId, userId);
|
|
72
72
|
};
|
|
73
73
|
|
|
74
|
-
const
|
|
75
|
-
return await
|
|
74
|
+
const findAllUserRoles = async (workspaceId) => {
|
|
75
|
+
return await getMembers(workspaceId);
|
|
76
76
|
};
|
|
77
77
|
|
|
78
78
|
const createUserRole = async (data) => {
|
|
@@ -80,15 +80,10 @@ const createUserRole = async (data) => {
|
|
|
80
80
|
return await updateCachedMembers(savedRole?.workspaceId?.toString());
|
|
81
81
|
};
|
|
82
82
|
|
|
83
|
-
const findOneAndUpdateUserRole = async ({
|
|
84
|
-
workspaceId,
|
|
85
|
-
userId,
|
|
86
|
-
userShift,
|
|
87
|
-
role,
|
|
88
|
-
}) => {
|
|
83
|
+
const findOneAndUpdateUserRole = async (filter, payload) => {
|
|
89
84
|
await UserRole.findOneAndUpdate(
|
|
90
|
-
|
|
91
|
-
{ $set:
|
|
85
|
+
filter,
|
|
86
|
+
{ $set: payload },
|
|
92
87
|
{ new: true, upsert: false }
|
|
93
88
|
)
|
|
94
89
|
.lean()
|
|
@@ -221,7 +216,7 @@ const findUserWorkspaces = async (userId) => {
|
|
|
221
216
|
module.exports = {
|
|
222
217
|
createUserRole,
|
|
223
218
|
updateUserRole,
|
|
224
|
-
|
|
219
|
+
findAllUserRoles,
|
|
225
220
|
deleteUserRoleByFilter,
|
|
226
221
|
findUserWorkspaces,
|
|
227
222
|
getUserRoleWithPermissions,
|