1
0
Fork 0
mirror of synced 2024-06-28 19:10:33 +12:00

Revert formatting to 80 print width

This commit is contained in:
Andrew Kingston 2020-09-14 14:35:03 +01:00
parent c4683a3743
commit 76cfb5062d
4 changed files with 40 additions and 10 deletions

View file

@ -4,6 +4,5 @@
"singleQuote": false,
"trailingComma": "es5",
"plugins": ["prettier-plugin-svelte"],
"svelteSortOrder" : "scripts-markup-styles",
"printWidth": 100
"svelteSortOrder" : "scripts-markup-styles"
}

View file

@ -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 }

View file

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

View file

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