mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 05:45:50 +00:00
Remove loader on error
This commit is contained in:
@@ -234,9 +234,11 @@ export class NewEventPage implements OnInit {
|
|||||||
|
|
||||||
let eventId: any;
|
let eventId: any;
|
||||||
|
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
const loader = this.toastService.loading()
|
|
||||||
|
|
||||||
if(this.loggeduser.Profile == 'MDGPR') {
|
if(this.loggeduser.Profile == 'MDGPR') {
|
||||||
console.log(this.loggeduser.Profile);
|
console.log(this.loggeduser.Profile);
|
||||||
@@ -245,14 +247,12 @@ export class NewEventPage implements OnInit {
|
|||||||
|
|
||||||
eventId = await this.eventService.postEventMd(this.postEvent, this.postEvent.CalendarName).toPromise();
|
eventId = await this.eventService.postEventMd(this.postEvent, this.postEvent.CalendarName).toPromise();
|
||||||
console.log(eventId);
|
console.log(eventId);
|
||||||
loader.remove()
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else if(this.loggeduser.Profile == 'PR'){
|
else if(this.loggeduser.Profile == 'PR'){
|
||||||
console.log(this.loggeduser.Profile);
|
console.log(this.loggeduser.Profile);
|
||||||
|
|
||||||
eventId = await this.eventService.postEventPr(this.postEvent, this.postEvent.CalendarName).toPromise();
|
eventId = await this.eventService.postEventPr(this.postEvent, this.postEvent.CalendarName).toPromise();
|
||||||
loader.remove()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const DocumentToSave: EventAttachment[] = this.documents.map((e) => {
|
const DocumentToSave: EventAttachment[] = this.documents.map((e) => {
|
||||||
@@ -284,6 +284,8 @@ export class NewEventPage implements OnInit {
|
|||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.toastService.badRequest()
|
this.toastService.badRequest()
|
||||||
|
} finally {
|
||||||
|
loader.remove()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user