mirror of
https://github.com/ArthurDanjou/artdanj-shortener.git
synced 2026-01-14 15:54:08 +01:00
25 lines
551 B
TypeScript
Executable File
25 lines
551 B
TypeScript
Executable File
import {HttpContextContract} from '@ioc:Adonis/Core/HttpContext'
|
|
import {rules, schema} from '@ioc:Adonis/Core/Validator'
|
|
|
|
export default class UserStoreValidator {
|
|
constructor (protected ctx: HttpContextContract) {}
|
|
|
|
public schema = schema.create({
|
|
email: schema.string({ trim: true }, [
|
|
rules.email(),
|
|
rules.required(),
|
|
rules.unique({
|
|
table: 'users',
|
|
column: 'email'
|
|
})
|
|
]),
|
|
password: schema.string({ trim: true },
|
|
[
|
|
rules.confirmed()
|
|
]
|
|
)
|
|
})
|
|
|
|
public messages = {}
|
|
}
|