From aeb7c5dfc90af57a803321e2a86f7509a17e452a Mon Sep 17 00:00:00 2001 From: kevmodrome Date: Wed, 27 May 2020 13:51:19 +0200 Subject: [PATCH] fix lint erorrs --- packages/server/src/api/controllers/user.js | 2 +- .../server/src/api/controllers/workflow.js | 9 +++---- .../src/api/routes/tests/couchTestUtils.js | 4 +-- packages/server/src/schemas/index.js | 26 +++++++++---------- 4 files changed, 19 insertions(+), 22 deletions(-) diff --git a/packages/server/src/api/controllers/user.js b/packages/server/src/api/controllers/user.js index f654caa4c0..5810872989 100644 --- a/packages/server/src/api/controllers/user.js +++ b/packages/server/src/api/controllers/user.js @@ -61,7 +61,7 @@ exports.create = async function(ctx) { } } -exports.update = async function(ctx) {} +exports.update = async function() {} exports.destroy = async function(ctx) { const database = new CouchDB(ctx.params.instanceId) diff --git a/packages/server/src/api/controllers/workflow.js b/packages/server/src/api/controllers/workflow.js index 216ca6afd2..e257151d37 100644 --- a/packages/server/src/api/controllers/workflow.js +++ b/packages/server/src/api/controllers/workflow.js @@ -2,8 +2,6 @@ const CouchDB = require("../../db") const Ajv = require("ajv") const newid = require("../../db/newid") -const ajv = new Ajv() - exports.create = async function(ctx) { const db = new CouchDB(ctx.params.instanceId) const workflow = ctx.request.body @@ -28,7 +26,6 @@ exports.create = async function(ctx) { // return // } - workflow.type = "workflow" const response = await db.post(workflow) workflow._rev = response.rev @@ -38,9 +35,9 @@ exports.create = async function(ctx) { message: "Workflow created successfully", workflow: { ...workflow, - ...response - } - }; + ...response, + }, + } } exports.update = async function(ctx) { diff --git a/packages/server/src/api/routes/tests/couchTestUtils.js b/packages/server/src/api/routes/tests/couchTestUtils.js index aa7a765d25..de4ed7f87e 100644 --- a/packages/server/src/api/routes/tests/couchTestUtils.js +++ b/packages/server/src/api/routes/tests/couchTestUtils.js @@ -98,5 +98,5 @@ exports.insertDocument = async (databaseId, document) => { } exports.destroyDocument = async (databaseId, documentId) => { - return await new CouchDB(databaseId).destroy(documentId); -} \ No newline at end of file + return await new CouchDB(databaseId).destroy(documentId) +} diff --git a/packages/server/src/schemas/index.js b/packages/server/src/schemas/index.js index 23a839bf97..9ab8736a7a 100644 --- a/packages/server/src/schemas/index.js +++ b/packages/server/src/schemas/index.js @@ -2,22 +2,22 @@ const WORKFLOW_SCHEMA = { properties: { type: "workflow", pageId: { - type: "string" + type: "string", }, screenId: { - type: "string" + type: "string", }, live: { - type: "boolean" + type: "boolean", }, uiTree: { - type: "object" + type: "object", }, definition: { type: "object", properties: { triggers: { type: "array" }, - next: { + next: { type: "object", properties: { type: { type: "string" }, @@ -25,14 +25,14 @@ const WORKFLOW_SCHEMA = { args: { type: "object" }, conditions: { type: "array" }, errorHandling: { type: "object" }, - next: { type: "object" } - } + next: { type: "object" }, + }, }, - } - } - } -}; + }, + }, + }, +} module.exports = { - WORKFLOW_SCHEMA -}; \ No newline at end of file + WORKFLOW_SCHEMA, +}