edit recurrence event

This commit is contained in:
Eudes Inácio
2024-06-13 12:14:48 +01:00
parent 35b1f3ae08
commit b0583ce9e6
7 changed files with 84 additions and 13 deletions
@@ -428,7 +428,7 @@
<ion-footer class="ion-no-border">
<ion-toolbar class="width-100 d-flex justify-space-between px-20">
<ion-buttons slot="start">
<button class="btn-ok" fill="clear" color="#fff" (click)="save_v2()">
<button class="btn-ok" fill="clear" color="#fff" (click)="validationEditAllEvent()">
<ion-label>Gravar</ion-label>
</button>
</ion-buttons>
@@ -353,7 +353,48 @@ export class EditEventPage implements OnInit {
}
async save_v2() {
validationEditAllEvent() {
if (this.postEvent.IsRecurring) {
this.alertController.create({
header: 'Editar evento?',
message: 'Este evento tem recorrência, deseja editar a Sequência de eventos?',
inputs: [
{
name: 'confirm',
type: 'checkbox',
label: '',
value: 'confirm',
checked: false
}
],
buttons: [
{
text: 'Sim',
handler: (data) => {
// Check if the checkbox is checked
if (data.includes('confirm')) {
this.save_v2(true)
} else {
this.save_v2(false)
}
}
},
{
text: 'Não',
handler: () => {
this.save_v2(false)
}
}
]
}).then(res => {
res.present();
});
} else {
this.save_v2(false)
}
}
async save_v2(editAllEvent) {
this.injectValidation()
this.runValidation()
@@ -366,7 +407,7 @@ export class EditEventPage implements OnInit {
try {
this.agendaDataRepository.updateEvent(this._postEvent.EventId, this._postEvent,false).subscribe((value) => {
this.agendaDataRepository.updateEvent(this._postEvent.EventId, this._postEvent,editAllEvent).subscribe((value) => {
console.log(value)
}, ((error) => {
console.log('edit event error: ', error)