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