shuttlepro-shared 1.2.69 → 1.2.71
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.
|
@@ -6,7 +6,6 @@ const defaultSelect =
|
|
|
6
6
|
|
|
7
7
|
// Cache keys
|
|
8
8
|
const CACHE_KEY_ALL_MEMBERS = "userroles_all_members";
|
|
9
|
-
const CACHE_KEY_USER_PERMISSIONS_PREFIX = "user_permissions_";
|
|
10
9
|
|
|
11
10
|
const getCachedMembers = async (filter = {}) => {
|
|
12
11
|
try {
|
|
@@ -134,24 +133,12 @@ const updateCachedMembers = async (filter = {}) => {
|
|
|
134
133
|
// Comprehensive cache update method
|
|
135
134
|
const updateAllRelatedCaches = async (userId, workspaceId) => {
|
|
136
135
|
try {
|
|
137
|
-
// Update all members cache
|
|
138
136
|
await updateCachedMembers();
|
|
139
|
-
|
|
140
|
-
// Clear user permissions cache
|
|
141
|
-
if (workspaceId && userId) {
|
|
142
|
-
await clearUserPermissionsCache(workspaceId, userId);
|
|
143
|
-
}
|
|
144
137
|
} catch (error) {
|
|
145
138
|
console.error("Error updating related caches:", error);
|
|
146
139
|
}
|
|
147
140
|
};
|
|
148
141
|
|
|
149
|
-
// Clear user permissions cache
|
|
150
|
-
const clearUserPermissionsCache = async (workspaceId, userId) => {
|
|
151
|
-
const cacheKey = `${CACHE_KEY_USER_PERMISSIONS_PREFIX}${workspaceId}_${userId}`;
|
|
152
|
-
await setRedisData(cacheKey, null, null, 0);
|
|
153
|
-
};
|
|
154
|
-
|
|
155
142
|
// Find single user role by filter
|
|
156
143
|
const findSingleUserRoleByFilter = async (
|
|
157
144
|
filter = {},
|