2021-06-30 15:01:07 +01:00
|
|
|
import { Component, OnInit } from '@angular/core';
|
2021-06-30 15:48:37 +01:00
|
|
|
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
|
|
|
|
|
import { PublicationsService } from 'src/app/services/publications.service';
|
2021-06-30 15:01:07 +01:00
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
selector: 'app-actions-options',
|
|
|
|
|
templateUrl: './actions-options.page.html',
|
|
|
|
|
styleUrls: ['./actions-options.page.scss'],
|
|
|
|
|
})
|
|
|
|
|
export class ActionsOptionsPage implements OnInit {
|
|
|
|
|
|
2021-06-30 15:48:37 +01:00
|
|
|
id:string;
|
|
|
|
|
|
2021-06-30 15:01:07 +01:00
|
|
|
constructor(
|
|
|
|
|
private popoverController: PopoverController,
|
|
|
|
|
private modalController: ModalController,
|
2021-06-30 15:48:37 +01:00
|
|
|
private navParams: NavParams,
|
|
|
|
|
private publicationsService: PublicationsService,
|
|
|
|
|
) {
|
|
|
|
|
this.id = this.navParams.get('id');
|
|
|
|
|
}
|
2021-06-30 15:01:07 +01:00
|
|
|
|
|
|
|
|
ngOnInit() {
|
2021-06-30 15:48:37 +01:00
|
|
|
console.log(this.id);
|
|
|
|
|
|
2021-06-30 15:01:07 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
close () {
|
|
|
|
|
this.modalController.dismiss();
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-30 16:12:47 +01:00
|
|
|
editAction(){
|
|
|
|
|
this.modalController.dismiss('edit');
|
|
|
|
|
}
|
2021-06-30 15:01:07 +01:00
|
|
|
|
|
|
|
|
deleteAction(){
|
2021-06-30 15:48:37 +01:00
|
|
|
this.publicationsService.DeletePresidentialAction(this.id).toPromise();
|
|
|
|
|
this.close();
|
2021-06-30 15:01:07 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|