form
All checks were successful
deploy to production / deploy (push) Successful in 49s

This commit is contained in:
2023-09-24 09:38:03 +00:00
parent 7813f0b486
commit eee191955e
32 changed files with 1091 additions and 518 deletions

View File

@@ -1,13 +1,14 @@
const { validateFields } = require("./validateFields")
;(function () {
if (context.data.formular.honey) {
if (context?.data?.formular?.honey) {
throw { status: 400, error: "Bot detection" }
}
delete context.data.formular.honey
let values = Object.entries(context.data.formular)
/**
* @type {Array<[string, FormObj]>}
*/
let values = Object.entries(context?.data?.formular)
let validation = validateFields(values)
console.log(validation)
if (validation.length) {
throw { status: 400, error: validation }
}