mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-09 15:24:55 +02:00
Update controllers to use new user model
This commit is contained in:
@ -1,11 +1,11 @@
|
||||
const CacheManager = require('../managers/CacheManager')
|
||||
|
||||
class CacheController {
|
||||
constructor() { }
|
||||
constructor() {}
|
||||
|
||||
// POST: api/cache/purge
|
||||
async purgeCache(req, res) {
|
||||
if (!req.user.isAdminOrUp) {
|
||||
if (!req.userNew.isAdminOrUp) {
|
||||
return res.sendStatus(403)
|
||||
}
|
||||
await CacheManager.purgeAll()
|
||||
@ -14,11 +14,11 @@ class CacheController {
|
||||
|
||||
// POST: api/cache/items/purge
|
||||
async purgeItemsCache(req, res) {
|
||||
if (!req.user.isAdminOrUp) {
|
||||
if (!req.userNew.isAdminOrUp) {
|
||||
return res.sendStatus(403)
|
||||
}
|
||||
await CacheManager.purgeItems()
|
||||
res.sendStatus(200)
|
||||
}
|
||||
}
|
||||
module.exports = new CacheController()
|
||||
module.exports = new CacheController()
|
||||
|
Reference in New Issue
Block a user