mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-06-21 16:39:13 +02:00
Add:Notification settings, notification manager trigger #996
This commit is contained in:
parent
9a7503cde2
commit
ff04eb8d5e
9 changed files with 239 additions and 5 deletions
25
server/controllers/NotificationController.js
Normal file
25
server/controllers/NotificationController.js
Normal file
|
@ -0,0 +1,25 @@
|
|||
const Logger = require('../Logger')
|
||||
|
||||
class NotificationController {
|
||||
constructor() { }
|
||||
|
||||
get(req, res) {
|
||||
res.json(this.db.notificationSettings)
|
||||
}
|
||||
|
||||
async update(req, res) {
|
||||
const updated = this.db.notificationSettings.update(req.body)
|
||||
if (updated) {
|
||||
await this.db.updateEntity('settings', this.db.notificationSettings)
|
||||
}
|
||||
res.sendStatus(200)
|
||||
}
|
||||
|
||||
middleware(req, res, next) {
|
||||
if (!req.user.isAdminOrUp) {
|
||||
return res.sendStatus(404)
|
||||
}
|
||||
next()
|
||||
}
|
||||
}
|
||||
module.exports = new NotificationController()
|
Loading…
Add table
Add a link
Reference in a new issue