Files
artdanj-api/app/Validators/locations/UpdateValidator.ts
2020-12-16 15:54:29 +01:00

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 !'
}
}