Formatting.
This commit is contained in:
parent
4d49fd4da0
commit
1a2556b6fd
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue