mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-01-24 08:40:26 +01:00
Add PostColor and content
This commit is contained in:
16
app/Validators/postColor/PostColorStoreValidator.ts
Executable file
16
app/Validators/postColor/PostColorStoreValidator.ts
Executable file
@@ -0,0 +1,16 @@
|
||||
import {schema} from '@ioc:Adonis/Core/Validator'
|
||||
import {HttpContextContract} from '@ioc:Adonis/Core/HttpContext'
|
||||
|
||||
export default class PostColorStoreValidator {
|
||||
constructor (protected ctx: HttpContextContract) {
|
||||
}
|
||||
|
||||
public schema = schema.create({
|
||||
name: schema.string(),
|
||||
color: schema.string()
|
||||
})
|
||||
|
||||
public messages = {
|
||||
required: 'The field {{field}} is required'
|
||||
}
|
||||
}
|
||||
16
app/Validators/postColor/PostColorUpdateValidator.ts
Normal file
16
app/Validators/postColor/PostColorUpdateValidator.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import {schema} from '@ioc:Adonis/Core/Validator'
|
||||
import {HttpContextContract} from '@ioc:Adonis/Core/HttpContext'
|
||||
|
||||
export default class PostColorUpdateValidator {
|
||||
public schema = schema.create({
|
||||
name: schema.string.optional(),
|
||||
color: schema.string.optional()
|
||||
})
|
||||
|
||||
public messages = {
|
||||
required: 'The field {{field}} is required'
|
||||
}
|
||||
|
||||
constructor (protected ctx: HttpContextContract) {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user