From 6fe5055e9d62a6ae06128bf61a55960537e02091 Mon Sep 17 00:00:00 2001 From: Zephyrrus Date: Thu, 17 Jun 2021 01:13:15 +0300 Subject: feat: show setting values on the settings page and implement sending to backend (no saving yet) --- src/api/routes/service/configPOST.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/api/routes/service/configPOST.js (limited to 'src/api') diff --git a/src/api/routes/service/configPOST.js b/src/api/routes/service/configPOST.js new file mode 100644 index 0000000..28d034d --- /dev/null +++ b/src/api/routes/service/configPOST.js @@ -0,0 +1,20 @@ +const Joi = require('joi'); + +const Route = require('../../structures/Route'); +const Util = require('../../utils/Util'); + +const { schema } = require('../../structures/Setting'); + +class configGET extends Route { + constructor() { + super('/service/config', 'post', { adminOnly: true }); + } + + run(req, res) { + const { settings } = req.body; + const validationRes = schema.validate(settings, { abortEarly: false }); + console.log(JSON.stringify(validationRes)); + } +} + +module.exports = configGET; -- cgit v1.2.3