mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-01-14 20:19:26 +01:00
23 lines
589 B
TypeScript
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) {
|
|
}
|
|
}
|