From 15223080d59e628487b964d8079ea9ec07a6858a Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 21 Apr 2021 16:46:51 +0100 Subject: [PATCH] Formatting and linting. --- packages/auth/src/index.js | 2 +- .../src/api/controllers/admin/groups.js | 6 +++++- .../src/api/controllers/admin/templates.js | 19 +++++++++++++------ .../worker/src/api/routes/admin/groups.js | 6 +----- .../worker/src/api/routes/admin/templates.js | 8 +++----- packages/worker/src/api/routes/admin/users.js | 6 +----- 6 files changed, 24 insertions(+), 23 deletions(-) diff --git a/packages/auth/src/index.js b/packages/auth/src/index.js index 937b1491c5..0961e15232 100644 --- a/packages/auth/src/index.js +++ b/packages/auth/src/index.js @@ -31,7 +31,7 @@ module.exports = { db: require("./db/utils"), utils: { ...require("./utils"), - ...require("./hashing") + ...require("./hashing"), }, auth: { buildAuthMiddleware: authenticated, diff --git a/packages/worker/src/api/controllers/admin/groups.js b/packages/worker/src/api/controllers/admin/groups.js index 0943a58b1f..baa510f487 100644 --- a/packages/worker/src/api/controllers/admin/groups.js +++ b/packages/worker/src/api/controllers/admin/groups.js @@ -1,5 +1,9 @@ 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 diff --git a/packages/worker/src/api/controllers/admin/templates.js b/packages/worker/src/api/controllers/admin/templates.js index 5a2e018702..e445f611a8 100644 --- a/packages/worker/src/api/controllers/admin/templates.js +++ b/packages/worker/src/api/controllers/admin/templates.js @@ -1,18 +1,25 @@ -const { generateTemplateID, getTemplateParams } = require("@budibase/auth").db -const { CouchDB } = require("../../../db") +// const { generateTemplateID, getTemplateParams, StaticDatabases } = require("@budibase/auth").db +// const { CouchDB } = require("../../../db") + +// const GLOBAL_DB = StaticDatabases.GLOBAL.name exports.save = async ctx => { - + // const db = new CouchDB(GLOBAL_DB) + // const id = generateTemplateID() + ctx.body = {} } exports.fetch = async ctx => { - + // const db = new CouchDB(GLOBAL_DB) + ctx.body = {} } exports.find = async ctx => { - + // const db = new CouchDB(GLOBAL_DB) + ctx.body = {} } exports.destroy = async ctx => { - + // const db = new CouchDB(GLOBAL_DB) + ctx.body = {} } diff --git a/packages/worker/src/api/routes/admin/groups.js b/packages/worker/src/api/routes/admin/groups.js index c9d9f1c92f..6ae8780a22 100644 --- a/packages/worker/src/api/routes/admin/groups.js +++ b/packages/worker/src/api/routes/admin/groups.js @@ -24,11 +24,7 @@ function buildGroupSaveValidation() { } router - .post( - "/api/admin/groups", - buildGroupSaveValidation(), - controller.save - ) + .post("/api/admin/groups", buildGroupSaveValidation(), controller.save) .get("/api/admin/groups", controller.fetch) .delete("/api/admin/groups/:id", controller.destroy) .get("/api/admin/groups/:id", controller.find) diff --git a/packages/worker/src/api/routes/admin/templates.js b/packages/worker/src/api/routes/admin/templates.js index 0632d82ec2..9c66b87200 100644 --- a/packages/worker/src/api/routes/admin/templates.js +++ b/packages/worker/src/api/routes/admin/templates.js @@ -1,13 +1,11 @@ const Router = require("@koa/router") const controller = require("../../controllers/admin/templates") -const joiValidator = require("../../../middleware/joi-validator") -const Joi = require("joi") +// const joiValidator = require("../../../middleware/joi-validator") +// const Joi = require("joi") const router = Router() -function buildTemplateSaveValidation() { - -} +function buildTemplateSaveValidation() {} router .post( diff --git a/packages/worker/src/api/routes/admin/users.js b/packages/worker/src/api/routes/admin/users.js index bd7d8bbbd5..f06153385e 100644 --- a/packages/worker/src/api/routes/admin/users.js +++ b/packages/worker/src/api/routes/admin/users.js @@ -25,11 +25,7 @@ function buildUserSaveValidation() { } router - .post( - "/api/admin/users", - buildUserSaveValidation(), - controller.userSave - ) + .post("/api/admin/users", buildUserSaveValidation(), controller.userSave) .get("/api/admin/users", controller.userFetch) .post("/api/admin/users/first", controller.firstUser) .delete("/api/admin/users/:id", controller.userDelete)