mirror of
https://git.sr.ht/~cadence/cloudtube
synced 2024-11-12 19:37:29 +00:00
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
Block a user