Formatting and linting.

This commit is contained in:
mike12345567 2021-04-21 16:46:51 +01:00
parent 76ceb6a951
commit 15223080d5
6 changed files with 24 additions and 23 deletions

View File

@ -31,7 +31,7 @@ module.exports = {
db: require("./db/utils"), db: require("./db/utils"),
utils: { utils: {
...require("./utils"), ...require("./utils"),
...require("./hashing") ...require("./hashing"),
}, },
auth: { auth: {
buildAuthMiddleware: authenticated, buildAuthMiddleware: authenticated,

View File

@ -1,5 +1,9 @@
const CouchDB = require("../../../db") const CouchDB = require("../../../db")
const { getGroupParams, generateGroupID, StaticDatabases } = require("@budibase/auth").db const {
getGroupParams,
generateGroupID,
StaticDatabases,
} = require("@budibase/auth").db
const GLOBAL_DB = StaticDatabases.GLOBAL.name const GLOBAL_DB = StaticDatabases.GLOBAL.name

View File

@ -1,18 +1,25 @@
const { generateTemplateID, getTemplateParams } = require("@budibase/auth").db // const { generateTemplateID, getTemplateParams, StaticDatabases } = require("@budibase/auth").db
const { CouchDB } = require("../../../db") // const { CouchDB } = require("../../../db")
// const GLOBAL_DB = StaticDatabases.GLOBAL.name
exports.save = async ctx => { exports.save = async ctx => {
// const db = new CouchDB(GLOBAL_DB)
// const id = generateTemplateID()
ctx.body = {}
} }
exports.fetch = async ctx => { exports.fetch = async ctx => {
// const db = new CouchDB(GLOBAL_DB)
ctx.body = {}
} }
exports.find = async ctx => { exports.find = async ctx => {
// const db = new CouchDB(GLOBAL_DB)
ctx.body = {}
} }
exports.destroy = async ctx => { exports.destroy = async ctx => {
// const db = new CouchDB(GLOBAL_DB)
ctx.body = {}
} }

View File

@ -24,11 +24,7 @@ function buildGroupSaveValidation() {
} }
router router
.post( .post("/api/admin/groups", buildGroupSaveValidation(), controller.save)
"/api/admin/groups",
buildGroupSaveValidation(),
controller.save
)
.get("/api/admin/groups", controller.fetch) .get("/api/admin/groups", controller.fetch)
.delete("/api/admin/groups/:id", controller.destroy) .delete("/api/admin/groups/:id", controller.destroy)
.get("/api/admin/groups/:id", controller.find) .get("/api/admin/groups/:id", controller.find)

View File

@ -1,13 +1,11 @@
const Router = require("@koa/router") const Router = require("@koa/router")
const controller = require("../../controllers/admin/templates") const controller = require("../../controllers/admin/templates")
const joiValidator = require("../../../middleware/joi-validator") // const joiValidator = require("../../../middleware/joi-validator")
const Joi = require("joi") // const Joi = require("joi")
const router = Router() const router = Router()
function buildTemplateSaveValidation() { function buildTemplateSaveValidation() {}
}
router router
.post( .post(

View File

@ -25,11 +25,7 @@ function buildUserSaveValidation() {
} }
router router
.post( .post("/api/admin/users", buildUserSaveValidation(), controller.userSave)
"/api/admin/users",
buildUserSaveValidation(),
controller.userSave
)
.get("/api/admin/users", controller.userFetch) .get("/api/admin/users", controller.userFetch)
.post("/api/admin/users/first", controller.firstUser) .post("/api/admin/users/first", controller.firstUser)
.delete("/api/admin/users/:id", controller.userDelete) .delete("/api/admin/users/:id", controller.userDelete)