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