mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-01-14 12:14:33 +01:00
23 lines
662 B
TypeScript
23 lines
662 B
TypeScript
import {schema} from '@ioc:Adonis/Core/Validator'
|
|
import {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(),
|
|
})
|
|
public messages = {
|
|
required: 'The field {{field}} is required'
|
|
}
|
|
|
|
constructor (protected ctx: HttpContextContract) {
|
|
}
|
|
}
|