mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-01-14 20:19:26 +01:00
debug
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import {schema} from '@ioc:Adonis/Core/Validator'
|
||||
|
||||
export default class StoreValidator {
|
||||
export default class LocationValidator {
|
||||
constructor (private ctx: HttpContextContract) {
|
||||
}
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import {rules, schema} from '@ioc:Adonis/Core/Validator'
|
||||
|
||||
export default class StoreValidator {
|
||||
constructor (private ctx: HttpContextContract) {
|
||||
}
|
||||
|
||||
public schema = schema.create({
|
||||
title: schema.string(),
|
||||
content: schema.string(),
|
||||
description: schema.string(),
|
||||
readingTime: schema.number(),
|
||||
coverId: schema.number([rules.exists({ table: 'files', column: 'id' })]),
|
||||
tags: schema.array().members(
|
||||
schema.number()
|
||||
),
|
||||
lightBackGround: schema.boolean()
|
||||
})
|
||||
|
||||
public cacheKey = this.ctx.routeKey
|
||||
|
||||
public messages = {
|
||||
required: 'Le champ {{field}} doit être valide !',
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import {rules, schema} from '@ioc:Adonis/Core/Validator'
|
||||
|
||||
export default class UpdateValidator {
|
||||
constructor (private ctx: HttpContextContract) {
|
||||
}
|
||||
|
||||
public schema = schema.create({
|
||||
title: schema.string.optional(),
|
||||
content: schema.string.optional(),
|
||||
description: schema.string.optional(),
|
||||
readingTime: schema.number.optional(),
|
||||
coverId: schema.number.optional([rules.exists({ table: 'files', column: 'id' })]),
|
||||
tags: schema.array.optional().members(
|
||||
schema.number()
|
||||
),
|
||||
lightBackGround: schema.boolean.optional()
|
||||
})
|
||||
|
||||
public cacheKey = this.ctx.routeKey
|
||||
|
||||
public messages = {
|
||||
required: 'Le champ {{field}} doit être valide !'
|
||||
}
|
||||
}
|
||||
19
app/Validators/project/ProjectValidator.ts
Normal file
19
app/Validators/project/ProjectValidator.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { schema } from '@ioc:Adonis/Core/Validator'
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
|
||||
export default class ProjectValidator {
|
||||
constructor (protected ctx: HttpContextContract) {
|
||||
}
|
||||
|
||||
public schema = schema.create({
|
||||
name: schema.string(),
|
||||
description: schema.string(),
|
||||
progress: schema.number(),
|
||||
url: schema.string()
|
||||
})
|
||||
|
||||
|
||||
public messages = {
|
||||
required: 'Le champ {{field}} doit être valide !',
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user