mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-06-23 17:29:19 +02:00
Update controllers to use new user model
This commit is contained in:
parent
202ceb02b5
commit
68ef3a07a7
20 changed files with 396 additions and 304 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue