mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
Fix delete
This commit is contained in:
@@ -9,6 +9,7 @@ import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { OptsExpedientePage } from '../../popover/opts-expediente/opts-expediente.page';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { EliminateEventPage } from 'src/app/modals/eliminate-event/eliminate-event.page';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-view-event',
|
||||
@@ -48,6 +49,7 @@ export class ViewEventPage implements OnInit {
|
||||
private modalController: ModalController,
|
||||
public popoverController: PopoverController,
|
||||
private toastService: ToastService,
|
||||
private alertService: AlertService,
|
||||
)
|
||||
{
|
||||
this.isEventEdited = false;
|
||||
@@ -118,12 +120,27 @@ export class ViewEventPage implements OnInit {
|
||||
async deleteEvent() {
|
||||
|
||||
if (this.loadedEvent.IsRecurring) {
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
} else {
|
||||
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName).subscribe(async () => {
|
||||
this.toastService.successMessage('Evento apagado');
|
||||
this.close();
|
||||
},()=>{},
|
||||
()=>{
|
||||
loader.remove();
|
||||
});
|
||||
} else {
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName).subscribe(async () => {
|
||||
this.toastService.successMessage('Evento apagado');
|
||||
this.close();
|
||||
},()=>{},
|
||||
()=>{
|
||||
loader.remove();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user