Add /api/settings to get current settings as JSON
This commit is contained in:
parent
f04be0d3f9
commit
5e6b2bf31c
|
@ -7,6 +7,17 @@ const validate = require("../utils/validate")
|
|||
const V = validate.V
|
||||
|
||||
module.exports = [
|
||||
{
|
||||
route: "/api/settings", methods: ["GET"], code: async ({req}) => {
|
||||
const user = getUser(req)
|
||||
const settings = user.getSettingsOrDefaults()
|
||||
return {
|
||||
statusCode: 200,
|
||||
contentType: "application/json",
|
||||
content: settings
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
route: "/settings", methods: ["GET"], code: async ({req}) => {
|
||||
const user = getUser(req)
|
||||
|
|
Loading…
Reference in New Issue