mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-01-14 20:19:26 +01:00
25 lines
747 B
TypeScript
25 lines
747 B
TypeScript
import { schema } from '@ioc:Adonis/Core/Validator'
|
|
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
|
|
|
export default class PostUpdateValidator {
|
|
public schema = schema.create({
|
|
slug: schema.string.optional(),
|
|
likes: schema.number.optional(),
|
|
tags: schema.array.optional().members(schema.string()),
|
|
title: schema.string.optional(),
|
|
description: schema.string.optional(),
|
|
cover: schema.string.optional(),
|
|
readingTime: schema.number.optional(),
|
|
date: schema.string.optional(),
|
|
color: schema.string.optional(),
|
|
content: schema.string.optional(),
|
|
})
|
|
|
|
public messages = {
|
|
required: 'The field {{field}} is required',
|
|
}
|
|
|
|
constructor(protected ctx: HttpContextContract) {
|
|
}
|
|
}
|