|
|
@@ -157,6 +157,7 @@ export default defineComponent({
|
|
|
saveBenevole() {
|
|
|
this.checkDone = true;
|
|
|
if (!this.areQuestionValid) {
|
|
|
+ Toast({ html: "Veuillez répondre à toutes les questions soulignées", classes: "error" });
|
|
|
return;
|
|
|
}
|
|
|
if (this.name == "") {
|
|
|
@@ -186,6 +187,18 @@ export default defineComponent({
|
|
|
.filter((q) => q.type == "text")
|
|
|
.map((q) => q.title + " : " + (this.commentObject[q.uuid] ?? ""))
|
|
|
.join("\n\r");
|
|
|
+ if (this.comment.length > 500) {
|
|
|
+ Toast({
|
|
|
+ html:
|
|
|
+ "Les réponses textuels sont trop longues<br>" +
|
|
|
+ this.comment.length +
|
|
|
+ "/500 charactères",
|
|
|
+
|
|
|
+ classes: "error",
|
|
|
+ });
|
|
|
+
|
|
|
+ return;
|
|
|
+ }
|
|
|
const benevole: BenevoleJSON = {
|
|
|
name: this.name,
|
|
|
surname: this.surname,
|
|
|
@@ -218,7 +231,8 @@ export default defineComponent({
|
|
|
})
|
|
|
.then((data: BenevoleJSON) => {
|
|
|
this.$emit("newRegistration", Benevole.fromJSON(data));
|
|
|
- });
|
|
|
+ })
|
|
|
+ .catch((error) => Toast({ html: "Erreur" + error, classes: "error" }));
|
|
|
},
|
|
|
},
|
|
|
});
|