mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
edit recurrence event
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user