diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/OnTheFly/Person.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/OnTheFly/Person.vue index c5f21a514..f740fc2cb 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/OnTheFly/Person.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/OnTheFly/Person.vue @@ -22,24 +22,45 @@
- +
- +
- +
- @@ -62,8 +83,8 @@
@@ -71,8 +92,8 @@
@@ -80,11 +101,17 @@ +
+ +
+ @@ -108,6 +135,7 @@ export default { config: { altNames: [] }, + errors: [] } }, computed: { @@ -183,6 +211,18 @@ export default { } }, methods: { + checkErrors(e) { + this.errors = []; + if (!this.person.lastName) { + this.errors.push("Le nom ne doit pas être vide."); + } + if (!this.person.firstName) { + this.errors.push("Le prénom ne doit pas être vide."); + } + if (!this.person.gender) { + this.errors.push("Le genre doit être renseigné"); + } + }, loadData() { getPerson(this.id) .then(person => new Promise((resolve, reject) => {