mirror of
https://github.com/sergeyyarkov/educt-server.git
synced 2026-10-11 18:29:15 +03:00
17 lines
573 B
TypeScript
17 lines
573 B
TypeScript
import { schema, rules } from '@ioc:Adonis/Core/Validator';
|
|
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext';
|
|
|
|
export default class UpdateUserValidator {
|
|
constructor(protected ctx: HttpContextContract) {}
|
|
|
|
public schema = schema.create({
|
|
first_name: schema.string(),
|
|
last_name: schema.string(),
|
|
login: schema.string({}, [rules.unique({ table: 'users', column: 'login' })]),
|
|
email: schema.string({}, [rules.email(), rules.unique({ table: 'contacts', column: 'email' })]),
|
|
password: schema.string(),
|
|
});
|
|
|
|
public messages = {};
|
|
}
|