|
|
@ -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) { |
|
|
|