shuttlepro-shared 1.2.32 → 1.2.33
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.
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
const { UserRole } = require("../../models/UserRole");
|
|
2
|
-
const {
|
|
2
|
+
const {
|
|
3
|
+
getDataFromRedisSet,
|
|
4
|
+
addDataToRedisSet,
|
|
5
|
+
} = require("../../config/redis");
|
|
3
6
|
|
|
4
7
|
const defaultSelect =
|
|
5
8
|
"iconUrl thumbUrl name productsCount ordersCount contact email address websiteUrl facebookUrl twitterUrl instagramUrl members defaultModule";
|
|
@@ -20,7 +23,7 @@ const getCachedMembers = async (filter = {}) => {
|
|
|
20
23
|
? `${CACHE_KEY_ALL_MEMBERS}_${JSON.stringify(filter)}`
|
|
21
24
|
: CACHE_KEY_ALL_MEMBERS;
|
|
22
25
|
|
|
23
|
-
let members = await
|
|
26
|
+
let members = await getDataFromRedisSet(cacheKey);
|
|
24
27
|
|
|
25
28
|
if (!members) {
|
|
26
29
|
members = await UserRole.find(filter)
|
|
@@ -121,7 +124,7 @@ const deleteUserRole = async (id) => {
|
|
|
121
124
|
const findUserWorkspaces = async (userId) => {
|
|
122
125
|
const cacheKey = `${CACHE_KEY_USER_WORKSPACE_PREFIX}${userId}`;
|
|
123
126
|
console.log(cacheKey, "cacheKey");
|
|
124
|
-
let userRoleWithWorkspaces = await
|
|
127
|
+
let userRoleWithWorkspaces = await getDataFromRedisSet(cacheKey);
|
|
125
128
|
|
|
126
129
|
console.log(userRoleWithWorkspaces, "userRoleWithWorkspaces");
|
|
127
130
|
|