improve form validation

This commit is contained in:
Peter Maquiran
2021-07-14 09:46:03 +01:00
parent d9f1ef7bba
commit 6176112001
5 changed files with 27 additions and 49 deletions
@@ -210,9 +210,6 @@ export class NewEventPage implements OnInit {
Categories: new FormControl(this.postEvent.Categories[0], [
Validators.required
]),
IsRecurring: new FormControl(this.postEvent.IsRecurring, [
Validators.required
]),
participantes: new FormControl(this.taskParticipants, [
Validators.required
]),
@@ -224,7 +221,9 @@ export class NewEventPage implements OnInit {
this.injectValidation()
this.runValidation()
if(this.Form.invalid) return false
if(this.Form.invalid) {
return false
}
if(this.documents.length >= 0) {
this.postEvent.HasAttachments = true;
@@ -59,8 +59,6 @@ export class DespachoPage implements OnInit {
this.caller = params["params"].caller;
}
});
alert('nice')
}
ngOnInit() {
@@ -367,14 +367,14 @@ export class PublicationsPage implements OnInit {
//translucent: true
});
await modal.present();
modal.onDidDismiss().then(res =>{
if(res['data']=='edit'){
modal.onDidDismiss().then(res => {
if(res['data']=='edit') {
this.closeDesktopComponent();
this.desktopComponent.showEditActions = true;
} else if (res['data']=='delete') {
setTimeout(()=>{
setTimeout(() => {
this.getActions();
},1000)
}, 1000)
this.closeDesktopComponent()
}
});