backend & types

This commit is contained in:
2024-01-27 18:58:35 +00:00
parent 66d0377a00
commit e5fba13002
864 changed files with 5211 additions and 13288 deletions

View File

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