Skip to content

Commit 7e6fd27

Browse files
authored
Merge pull request #127 from bountyC0d3r/develop
cache fix
2 parents ccb5f21 + 9d57d74 commit 7e6fd27

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/services/GroupService.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,8 @@ async function getGroup(currentUser, groupId, criteria) {
315315
)}`
316316
)
317317

318-
if (!_.has(criteria, 'isCache')) {
319-
criteria.isCache = true
318+
if (_.has(criteria, 'skipCache')) {
319+
criteria.skipCache = false
320320
}
321321

322322
if (criteria.includeSubGroups && criteria.includeParentGroup) {
@@ -372,12 +372,12 @@ async function getGroup(currentUser, groupId, criteria) {
372372
let groupToReturn
373373

374374
try {
375-
if (criteria.isCache) {
375+
if (!criteria.skipCache) {
376376
// check for the availibility of the group in cache
377377
groupToReturn = cache.get(groupId)
378378
}
379379

380-
if (criteria.isCache && groupToReturn) {
380+
if (!criteria.skipCache && groupToReturn) {
381381
if (!isAdmin) delete groupToReturn.status
382382

383383
// if the group is private, the user needs to be a member of the group, or an admin
@@ -480,6 +480,7 @@ getGroup.schema = {
480480
includeSubGroups: Joi.boolean().default(false),
481481
includeParentGroup: Joi.boolean().default(false),
482482
flattenGroupIdTree: Joi.boolean().default(false),
483+
skipCache: Joi.boolean().default(false),
483484
oneLevel: Joi.boolean(),
484485
fields: Joi.string()
485486
})

0 commit comments

Comments
 (0)