mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-01-27 18:10:27 +01:00
Working on posts
This commit is contained in:
21
app/Validators/post/PostStoreValidator.ts
Normal file
21
app/Validators/post/PostStoreValidator.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
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()
|
||||
})
|
||||
public messages = {
|
||||
required: 'The field {{field}} is required'
|
||||
}
|
||||
|
||||
constructor (protected ctx: HttpContextContract) {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user