Formatting.

This commit is contained in:
mike12345567 2021-05-05 16:00:15 +01:00
parent 5d2c1c23aa
commit 48236b2c2f
2 changed files with 11 additions and 4 deletions

View File

@ -48,9 +48,12 @@ exports.save = async function (ctx) {
exports.fetch = async function (ctx) {
const db = new CouchDB(GLOBAL_DB)
const response = await db.allDocs(
getConfigParams({ type: ctx.params.type }, {
getConfigParams(
{ type: ctx.params.type },
{
include_docs: true,
})
}
)
)
ctx.body = response.rows.map(row => row.doc)
}

View File

@ -68,7 +68,11 @@ function buildConfigGetValidation() {
router
.post("/api/admin/configs", buildConfigSaveValidation(), controller.save)
.delete("/api/admin/configs/:id", controller.destroy)
.get("/api/admin/configs/all/:type", buildConfigGetValidation(), controller.fetch)
.get(
"/api/admin/configs/all/:type",
buildConfigGetValidation(),
controller.fetch
)
.get("/api/admin/configs/:type", buildConfigGetValidation(), controller.find)
module.exports = router