From 609b039d4c7ab64d4f76c7ea93d51e2d83ecccfa Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 14 Sep 2020 14:35:03 +0100 Subject: [PATCH] Revert formatting to 80 print width --- .prettierrc | 3 +- packages/server/src/api/controllers/record.js | 9 ++++-- .../src/api/routes/tests/couchTestUtils.js | 6 +++- packages/server/src/api/routes/workflow.js | 32 ++++++++++++++++--- 4 files changed, 40 insertions(+), 10 deletions(-) diff --git a/.prettierrc b/.prettierrc index 6c36d6b4be..e23b0be753 100644 --- a/.prettierrc +++ b/.prettierrc @@ -4,6 +4,5 @@ "singleQuote": false, "trailingComma": "es5", "plugins": ["prettier-plugin-svelte"], - "svelteSortOrder" : "scripts-markup-styles", - "printWidth": 100 + "svelteSortOrder" : "scripts-markup-styles" } \ No newline at end of file diff --git a/packages/server/src/api/controllers/record.js b/packages/server/src/api/controllers/record.js index 2d2fa00869..f9cea706f5 100644 --- a/packages/server/src/api/controllers/record.js +++ b/packages/server/src/api/controllers/record.js @@ -110,7 +110,9 @@ exports.save = async function(ctx) { const doc = row.doc return { ...doc, - [model.name]: doc[model.name] ? [...doc[model.name], record._id] : [record._id], + [model.name]: doc[model.name] + ? [...doc[model.name], record._id] + : [record._id], } }) @@ -201,7 +203,10 @@ async function validate({ instanceId, modelId, record, model }) { } const errors = {} for (let fieldName in model.schema) { - const res = validateJs.single(record[fieldName], model.schema[fieldName].constraints) + const res = validateJs.single( + record[fieldName], + model.schema[fieldName].constraints + ) if (res) errors[fieldName] = res } return { valid: Object.keys(errors).length === 0, errors } diff --git a/packages/server/src/api/routes/tests/couchTestUtils.js b/packages/server/src/api/routes/tests/couchTestUtils.js index 13be04cf87..9183c76517 100644 --- a/packages/server/src/api/routes/tests/couchTestUtils.js +++ b/packages/server/src/api/routes/tests/couchTestUtils.js @@ -263,7 +263,11 @@ exports.builderEndpointShouldBlockNormalUsers = async ({ appId, instanceId, }) => { - const headers = await createUserWithAdminPermissions(request, appId, instanceId) + const headers = await createUserWithAdminPermissions( + request, + appId, + instanceId + ) await createRequest(request, method, url, body) .set(headers) diff --git a/packages/server/src/api/routes/workflow.js b/packages/server/src/api/routes/workflow.js index c7a59e4f81..cc4a7610e3 100644 --- a/packages/server/src/api/routes/workflow.js +++ b/packages/server/src/api/routes/workflow.js @@ -37,13 +37,35 @@ const workflowValidator = joiValidator.body(Joi.object({ }).unknown(true)) router - .get("/api/workflows/trigger/list", authorized(BUILDER), controller.getTriggerList) - .get("/api/workflows/action/list", authorized(BUILDER), controller.getActionList) - .get("/api/workflows/logic/list", authorized(BUILDER), controller.getLogicList) + .get( + "/api/workflows/trigger/list", + authorized(BUILDER), + controller.getTriggerList + ) + .get( + "/api/workflows/action/list", + authorized(BUILDER), + controller.getActionList + ) + .get( + "/api/workflows/logic/list", + authorized(BUILDER), + controller.getLogicList + ) .get("/api/workflows", authorized(BUILDER), controller.fetch) .get("/api/workflows/:id", authorized(BUILDER), controller.find) - .put("/api/workflows", authorized(BUILDER), workflowValidator, controller.update) - .post("/api/workflows", authorized(BUILDER), workflowValidator, controller.create) + .put( + "/api/workflows", + authorized(BUILDER), + workflowValidator, + controller.update + ) + .post( + "/api/workflows", + authorized(BUILDER), + workflowValidator, + controller.create + ) .post("/api/workflows/:id/trigger", controller.trigger) .delete("/api/workflows/:id/:rev", authorized(BUILDER), controller.destroy)