add cross channel reply setting

This commit is contained in:
Mystikfluu
2022-07-26 00:53:11 +02:00
parent b942dd73cd
commit e788d84194
4 changed files with 30 additions and 1 deletions
+5 -1
View File
@@ -1,3 +1,7 @@
const allowed_settings = { //"settingname":["validtypes"]
"ACCR": ["boolean"]
}
module.exports = {
"setup": function(router,con,server) {
router.get("/api/settings",function(req,res) {
@@ -14,7 +18,7 @@ module.exports = {
res.json({"error":"no setting to change"})
return
}
if((typeof req.body.value) != "string") {
if(!((typeof req.body.value) in allowed_settings[req.body.setting])) {
res.json({"error":"no new setting value given"})
return
}