diff options
| author | Zephyrrus <[email protected]> | 2021-06-17 01:13:15 +0300 |
|---|---|---|
| committer | Zephyrrus <[email protected]> | 2021-06-17 01:13:15 +0300 |
| commit | 6fe5055e9d62a6ae06128bf61a55960537e02091 (patch) | |
| tree | 95f6ff2d4120aff6cdc83f57a0244663ef982811 /src/api | |
| parent | feat: fetch all settings if admin (diff) | |
| download | host.fuwn.me-6fe5055e9d62a6ae06128bf61a55960537e02091.tar.xz host.fuwn.me-6fe5055e9d62a6ae06128bf61a55960537e02091.zip | |
feat: show setting values on the settings page and implement sending to backend (no saving yet)
Diffstat (limited to 'src/api')
| -rw-r--r-- | src/api/routes/service/configPOST.js | 20 |
1 files changed, 20 insertions, 0 deletions
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; |