mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 13:26:08 +00:00
Improve
This commit is contained in:
+19
-7
@@ -102,9 +102,12 @@ export class ApproveEventModalPage implements OnInit {
|
||||
console.log(body);
|
||||
try {
|
||||
await this.processes.PostTaskAction(body).toPromise()
|
||||
this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||
this.modalController.dismiss(null);
|
||||
this.successMessage('Evento aprovado')
|
||||
|
||||
this.successMessage('Evento aprovado', ()=>{
|
||||
this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||
this.modalController.dismiss(null);
|
||||
})
|
||||
|
||||
} catch (error) {
|
||||
this.badRequest('Evento não aprovado')
|
||||
}
|
||||
@@ -125,9 +128,12 @@ export class ApproveEventModalPage implements OnInit {
|
||||
|
||||
try {
|
||||
await this.processes.PostTaskAction(body).toPromise()
|
||||
this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||
|
||||
this.successMessage('Evento rejeitado', () =>{
|
||||
this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||
})
|
||||
|
||||
this.successMessage('Evento rejeitado')
|
||||
|
||||
} catch (error) {
|
||||
this.badRequest('Evento não rejeitado')
|
||||
}
|
||||
@@ -214,7 +220,7 @@ export class ApproveEventModalPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
async successMessage(message?: string) {
|
||||
async successMessage(message?: string, callback?) {
|
||||
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
const backdropAnimation = this.animationController.create()
|
||||
@@ -253,12 +259,15 @@ export class ApproveEventModalPage implements OnInit {
|
||||
modal.present()
|
||||
|
||||
setTimeout(()=>{
|
||||
if (callback) {
|
||||
callback()
|
||||
}
|
||||
modal.dismiss()
|
||||
},7000)
|
||||
|
||||
}
|
||||
|
||||
async badRequest(message?: string) {
|
||||
async badRequest(message?: string, callback?) {
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
const backdropAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
||||
@@ -296,6 +305,9 @@ export class ApproveEventModalPage implements OnInit {
|
||||
modal.present()
|
||||
|
||||
setTimeout(()=>{
|
||||
if (callback) {
|
||||
callback()
|
||||
}
|
||||
modal.dismiss()
|
||||
},7000)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user