fix lint erorrs

This commit is contained in:
kevmodrome 2020-05-27 13:51:19 +02:00
parent aa128509c1
commit aeb7c5dfc9
4 changed files with 19 additions and 22 deletions

View File

@ -61,7 +61,7 @@ exports.create = async function(ctx) {
} }
} }
exports.update = async function(ctx) {} exports.update = async function() {}
exports.destroy = async function(ctx) { exports.destroy = async function(ctx) {
const database = new CouchDB(ctx.params.instanceId) const database = new CouchDB(ctx.params.instanceId)

View File

@ -2,8 +2,6 @@ const CouchDB = require("../../db")
const Ajv = require("ajv") const Ajv = require("ajv")
const newid = require("../../db/newid") const newid = require("../../db/newid")
const ajv = new Ajv()
exports.create = async function(ctx) { exports.create = async function(ctx) {
const db = new CouchDB(ctx.params.instanceId) const db = new CouchDB(ctx.params.instanceId)
const workflow = ctx.request.body const workflow = ctx.request.body
@ -28,7 +26,6 @@ exports.create = async function(ctx) {
// return // return
// } // }
workflow.type = "workflow" workflow.type = "workflow"
const response = await db.post(workflow) const response = await db.post(workflow)
workflow._rev = response.rev workflow._rev = response.rev
@ -38,9 +35,9 @@ exports.create = async function(ctx) {
message: "Workflow created successfully", message: "Workflow created successfully",
workflow: { workflow: {
...workflow, ...workflow,
...response ...response,
},
} }
};
} }
exports.update = async function(ctx) { exports.update = async function(ctx) {

View File

@ -98,5 +98,5 @@ exports.insertDocument = async (databaseId, document) => {
} }
exports.destroyDocument = async (databaseId, documentId) => { exports.destroyDocument = async (databaseId, documentId) => {
return await new CouchDB(databaseId).destroy(documentId); return await new CouchDB(databaseId).destroy(documentId)
} }

View File

@ -2,16 +2,16 @@ const WORKFLOW_SCHEMA = {
properties: { properties: {
type: "workflow", type: "workflow",
pageId: { pageId: {
type: "string" type: "string",
}, },
screenId: { screenId: {
type: "string" type: "string",
}, },
live: { live: {
type: "boolean" type: "boolean",
}, },
uiTree: { uiTree: {
type: "object" type: "object",
}, },
definition: { definition: {
type: "object", type: "object",
@ -25,14 +25,14 @@ const WORKFLOW_SCHEMA = {
args: { type: "object" }, args: { type: "object" },
conditions: { type: "array" }, conditions: { type: "array" },
errorHandling: { type: "object" }, errorHandling: { type: "object" },
next: { type: "object" } next: { type: "object" },
}
}, },
} },
} },
} },
}; },
}
module.exports = { module.exports = {
WORKFLOW_SCHEMA WORKFLOW_SCHEMA,
}; }