initital commit

This commit is contained in:
2020-12-16 15:54:29 +01:00
commit a8ea2ef04a
75 changed files with 6664 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
import {rules, schema} from '@ioc:Adonis/Core/Validator'
export default class UpdateValidator {
constructor (private ctx: HttpContextContract) {
}
public schema = schema.create({
email: schema.string({ trim: true }, [
rules.email(),
rules.unique({table: 'subscribers', column: 'email'})
]),
name: schema.string.optional()
})
public cacheKey = this.ctx.routeKey
public messages = {
required: 'Le champ {{field}} doit être valide !'
}
}