19 lines
442 B
TypeScript
19 lines
442 B
TypeScript
import { schema, validator, rules } from '@ioc:Adonis/Core/Validator'
|
|
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
|
|
|
export default class CreateRoleValidator {
|
|
constructor (protected ctx: HttpContextContract) {
|
|
}
|
|
|
|
public reporter = validator.reporters.api
|
|
|
|
public schema = schema.create({
|
|
code: schema.string({}, [
|
|
rules.maxLength(4)
|
|
]),
|
|
name: schema.string({}, [
|
|
rules.maxLength(50)
|
|
]),
|
|
})
|
|
}
|