mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-01-14 12:14:33 +01:00
23 lines
603 B
TypeScript
23 lines
603 B
TypeScript
import {rules, schema} from '@ioc:Adonis/Core/Validator'
|
|
import {HttpContextContract} from '@ioc:Adonis/Core/HttpContext'
|
|
|
|
export default class TranslationUpdateValidator {
|
|
public schema = schema.create({
|
|
code: schema.string({}, [
|
|
rules.unique({
|
|
table: 'translations',
|
|
column: 'code'
|
|
})
|
|
]),
|
|
english: schema.string.optional(),
|
|
french: schema.string.optional()
|
|
})
|
|
public messages = {
|
|
required: 'The field {{field}} is required',
|
|
'code.unique': 'The translation code is not unique !'
|
|
}
|
|
|
|
constructor (protected ctx: HttpContextContract) {
|
|
}
|
|
}
|