mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-01-14 12:14:33 +01:00
20 lines
483 B
TypeScript
20 lines
483 B
TypeScript
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
|
import {schema} from '@ioc:Adonis/Core/Validator'
|
|
|
|
export default class UpdateValidator {
|
|
constructor (private ctx: HttpContextContract) {
|
|
}
|
|
|
|
public schema = schema.create({
|
|
place: schema.string.optional(),
|
|
since: schema.date.optional(),
|
|
left: schema.string.optional(),
|
|
})
|
|
|
|
public cacheKey = this.ctx.routeKey
|
|
|
|
public messages = {
|
|
required: 'Le champ {{field}} doit être valide !'
|
|
}
|
|
}
|