mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-28 07:20:49 -04:00
[bug] fix cache - don't use for admins
This commit is contained in:
parent
413237152a
commit
9566eee609
@ -32,7 +32,7 @@ router.get('/inclusive', handleErrorAsync(async (req, res) => {
|
||||
AND i.approved >= ${req.isGranted('inclusive') ? 0 : 1}
|
||||
AND i.deleted = 0
|
||||
`), 'insteadOf');
|
||||
}));
|
||||
}, !req.isGranted('inclusive')));
|
||||
}));
|
||||
|
||||
router.get('/inclusive/search/:term', handleErrorAsync(async (req, res) => {
|
||||
|
@ -80,7 +80,7 @@ router.get('/nouns', handleErrorAsync(async (req, res) => {
|
||||
AND n.approved >= ${req.isGranted('nouns') ? 0 : 1}
|
||||
ORDER BY n.approved, n.masc
|
||||
`))
|
||||
}));
|
||||
}, !req.isGranted('nouns')));
|
||||
}));
|
||||
|
||||
router.get('/nouns/search/:term', handleErrorAsync(async (req, res) => {
|
||||
|
@ -32,7 +32,7 @@ router.get('/terms', handleErrorAsync(async (req, res) => {
|
||||
AND i.approved >= ${req.isGranted('terms') ? 0 : 1}
|
||||
AND i.deleted = 0
|
||||
`), 'term');
|
||||
}));
|
||||
}, !req.isGranted('terms')));
|
||||
}));
|
||||
|
||||
router.get('/terms/search/:term', handleErrorAsync(async (req, res) => {
|
||||
|
@ -8,8 +8,8 @@ export class CacheObject {
|
||||
this.maxAgeMinutes = maxAgeMinutes;
|
||||
}
|
||||
|
||||
async fetch(generator) {
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
async fetch(generator, enabled = true) {
|
||||
if (process.env.NODE_ENV === 'development' || !enabled) {
|
||||
return await generator();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user