mirror of
https://github.com/sergeyyarkov/educt-server.git
synced 2026-10-11 18:29:15 +03:00
15 lines
469 B
TypeScript
15 lines
469 B
TypeScript
import { schema, rules } from '@ioc:Adonis/Core/Validator';
|
|
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext';
|
|
|
|
export default class UpdateLessonValidator {
|
|
constructor(protected ctx: HttpContextContract) {}
|
|
|
|
public schema = schema.create({
|
|
course_id: schema.string({}, [rules.exists({ table: 'courses', column: 'id' })]),
|
|
title: schema.string({}, [rules.maxLength(255)]),
|
|
description: schema.string(),
|
|
});
|
|
|
|
public messages = {};
|
|
}
|