build improvements

This commit is contained in:
Schneider Roland
2025-02-23 14:57:49 +01:00
parent 4d239f7c7a
commit 5c3fe39074
50 changed files with 1672 additions and 212 deletions

View File

@@ -0,0 +1,23 @@
import Ajv, {JSONSchemaType} from "ajv"
import addFormats from "ajv-formats"
import {ContactFormData} from "@/actions/contactus-actions";
const ajv = new Ajv({allErrors: true}) // options can be passed, e.g. {allErrors: true}
addFormats(ajv)
const contactUsFormSchema: JSONSchemaType<ContactFormData> = {
type: "object",
properties: {
firstname: {type: "string",minLength: 3,maxLength: 20},
lastname: {type: "string",minLength: 3,maxLength: 20},
phone: {type: "string",minLength: 3,maxLength: 20},
email: {type: "string", format: 'email'},
comment: {type: "string",minLength: 3,maxLength: 500}
},
required: ["firstname","lastname","phone","email","comment"],
additionalProperties: true
}
export const contactUsFormValidator = ajv.compile(contactUsFormSchema)