mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-01-19 22:41:35 +01:00
23 lines
502 B
TypeScript
Executable File
23 lines
502 B
TypeScript
Executable File
import {HttpContextContract} from '@ioc:Adonis/Core/HttpContext'
|
|
import {rules, schema} from '@ioc:Adonis/Core/Validator'
|
|
|
|
export default class GuestValidator {
|
|
constructor (private ctx: HttpContextContract) {
|
|
}
|
|
|
|
public schema = schema.create({
|
|
message: schema.string({}, [
|
|
rules.required()
|
|
]),
|
|
email: schema.string({}, [
|
|
rules.email()
|
|
])
|
|
})
|
|
|
|
public cacheKey = this.ctx.routeKey
|
|
|
|
public messages = {
|
|
required: 'Le champ {{field}} doit être valide !',
|
|
}
|
|
}
|