This commit is contained in:
Peter Maquiran
2021-07-27 22:34:47 +01:00
parent 2cb96a80ac
commit 999da281e8
5 changed files with 91 additions and 33 deletions
@@ -15,6 +15,7 @@ import { OptsExpedientePage } from 'src/app/shared/popover/opts-expediente/opts-
import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
import { ToastService } from 'src/app/services/toast.service';
import { EliminateEventPage } from 'src/app/modals/eliminate-event/eliminate-event.page';
import { Location } from '@angular/common'
@Component({
selector: 'app-view-event',
@@ -58,6 +59,7 @@ export class ViewEventPage implements OnInit {
private activatedRoute: ActivatedRoute,
private router: Router,
private toastService: ToastService,
private location: Location
)
{
this.isEventEdited = false;
@@ -128,13 +130,17 @@ export class ViewEventPage implements OnInit {
/* this.today = new Date(res.StartDate);
this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]); */
loader.remove()
}, ()=>{
}, (error)=>{
loader.remove()
this.toastService.badRequest('Este evento já não existe na sua agenda')
this.modalController.dismiss('Eevent not Foud');
this.router.navigate(['/home/agenda']);
if(error.status == 0) {
this.toastService.badRequest('não é possível vizualizar este event no modo offline')
} else {
this.toastService.badRequest('Este evento já não existe na sua agenda')
}
loader.remove()
this.modalController.dismiss('Eevent not Foud');
this.location.back();
});
}