Files
artdanj-api/app/Validators/post/PostStoreValidator.ts
2021-08-23 17:59:12 +02:00

23 lines
589 B
TypeScript

import {schema} from '@ioc:Adonis/Core/Validator'
import {HttpContextContract} from '@ioc:Adonis/Core/HttpContext'
export default class PostStoreValidator {
public schema = schema.create({
slug: schema.string(),
likes: schema.number(),
tags: schema.array().members(schema.string()),
title: schema.string(),
description: schema.string(),
cover: schema.string(),
readingTime: schema.number(),
date: schema.string(),
})
public messages = {
required: 'The field {{field}} is required'
}
constructor (protected ctx: HttpContextContract) {
}
}