mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-01-28 02:20:27 +01:00
Added Experiences and Formations
This commit is contained in:
@@ -5,38 +5,15 @@ export default class ExperienceUpdateValidator {
|
||||
constructor (protected ctx: HttpContextContract) {
|
||||
}
|
||||
|
||||
/*
|
||||
* Define schema to validate the "shape", "type", "formatting" and "integrity" of data.
|
||||
*
|
||||
* For example:
|
||||
* 1. The username must be of data type string. But then also, it should
|
||||
* not contain special characters or numbers.
|
||||
* ```
|
||||
* schema.string({}, [ rules.alpha() ])
|
||||
* ```
|
||||
*
|
||||
* 2. The email must be of data type string, formatted as a valid
|
||||
* email. But also, not used by any other user.
|
||||
* ```
|
||||
* schema.string({}, [
|
||||
* rules.email(),
|
||||
* rules.unique({ table: 'users', column: 'email' }),
|
||||
* ])
|
||||
* ```
|
||||
*/
|
||||
public schema = schema.create({
|
||||
title: schema.string.optional(),
|
||||
company: schema.string.optional(),
|
||||
location: schema.string.optional(),
|
||||
beginDate: schema.string.optional(),
|
||||
endDate: schema.string.optional()
|
||||
})
|
||||
|
||||
/**
|
||||
* Custom messages for validation failures. You can make use of dot notation `(.)`
|
||||
* for targeting nested fields and array expressions `(*)` for targeting all
|
||||
* children of an array. For example:
|
||||
*
|
||||
* {
|
||||
* 'profile.username.required': 'Username is required',
|
||||
* 'scores.*.number': 'Define scores as valid numbers'
|
||||
* }
|
||||
*
|
||||
*/
|
||||
public messages = {}
|
||||
public messages = {
|
||||
required: 'The field {{field}} is required'
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user