mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 05:16:07 +00:00
add either pattern
This commit is contained in:
@@ -118,25 +118,23 @@ export class ApproveEventPage implements OnInit {
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
this.agendaDataRepository.approveEvent(serialNumber).subscribe((value) => {
|
||||
console.log(value)
|
||||
this.modalController.dismiss(serialNumber);
|
||||
this.httpErroHandle.httpsSucessMessagge('Aprovar')
|
||||
this.TaskService.loadEventosParaAprovacao();
|
||||
}, ((error) => {
|
||||
console.log('aprove event error: ', error)
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
}))
|
||||
/* await this.processes.PostTaskAction(body).toPromise() */
|
||||
const result = await this.agendaDataRepository.approveEvent(serialNumber)// .subscribe((value) => {
|
||||
if(result.isOk()) {
|
||||
|
||||
} catch (error) {
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
} finally {
|
||||
this.close()
|
||||
loader.remove()
|
||||
console.log(result.value)
|
||||
this.modalController.dismiss(serialNumber);
|
||||
this.httpErroHandle.httpsSucessMessagge('Aprovar')
|
||||
this.TaskService.loadEventosParaAprovacao();
|
||||
} else {
|
||||
|
||||
console.log('aprove event error: ', result.error)
|
||||
this.httpErroHandle.httpStatusHandle(result.error)
|
||||
}
|
||||
|
||||
this.close()
|
||||
loader.remove()
|
||||
|
||||
|
||||
}
|
||||
|
||||
async rejectTask(serialNumber: string) {
|
||||
@@ -145,24 +143,20 @@ export class ApproveEventPage implements OnInit {
|
||||
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
const result = await this.agendaDataRepository.eventToaprovalStatus(serialNumber, 'Declined', "")//.subscribe((value) => {
|
||||
|
||||
try {
|
||||
/* await this.processes.PostTaskAction(body).toPromise() */
|
||||
this.agendaDataRepository.eventToaprovalStatus(serialNumber, 'Declined', "").subscribe((value) => {
|
||||
if(result.isOk()) {
|
||||
this.httpErroHandle.httpsSucessMessagge('Rejeitar');
|
||||
this.TaskService.loadEventosParaAprovacao();
|
||||
}, ((error) => {
|
||||
console.log('reject event error: ', error)
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
}))
|
||||
} catch (error) {
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
|
||||
} finally {
|
||||
loader.remove()
|
||||
this.close()
|
||||
} else {
|
||||
|
||||
console.log('reject event error: ', result.error)
|
||||
this.httpErroHandle.httpStatusHandle(result.error)
|
||||
}
|
||||
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
|
||||
@@ -235,23 +229,20 @@ export class ApproveEventPage implements OnInit {
|
||||
}
|
||||
|
||||
const loader = this.toastService.loading();
|
||||
|
||||
try {
|
||||
/* await this.processes.PostTaskAction(body).toPromise(); */
|
||||
this.agendaDataRepository.eventToaprovalStatus(serialNumber, 'Revision', res.data.note).subscribe((value) => {
|
||||
/* await this.processes.PostTaskAction(body).toPromise(); */
|
||||
const result = await this.agendaDataRepository.eventToaprovalStatus(serialNumber, 'Revision', res.data.note)// .subscribe((value) => {
|
||||
if(result.isOk()) {
|
||||
this.httpErroHandle.httpsSucessMessagge('Rever')
|
||||
this.TaskService.loadEventosParaAprovacao();
|
||||
this.close();
|
||||
},((error) => {
|
||||
console.log('send event to revision error: ', error)
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
}));
|
||||
} else {
|
||||
|
||||
console.log('send event to revision error: ', result.error)
|
||||
this.httpErroHandle.httpStatusHandle(result.error)
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user