merge made with peter branch

This commit is contained in:
Eudes Inácio
2024-06-18 12:26:54 +01:00
33 changed files with 438 additions and 217 deletions
@@ -169,8 +169,6 @@ export class EventsToApprovePage implements OnInit {
this.list = this.TaskService.reorderList(this.ordinance, list)
}
console.log(this.list)
}
@@ -216,31 +214,38 @@ export class EventsToApprovePage implements OnInit {
userId = this.selectedUserCalendar
}
let allEvents = await this.AgendaDataRepositoryService.eventToApproveList({
userId,
status: EEventFilterStatus.Pending
}, tracing)
if(allEvents.isOk()) {
tracing.setAttribute('outcome', 'success')
if(userId) {
let allEvents = await this.AgendaDataRepositoryService.eventToApproveList({
userId,
status: EEventFilterStatus.Pending
}, tracing)
if(allEvents.isOk()) {
tracing.setAttribute('outcome', 'success')
if(allEvents.value.length >= 1) {
this.eventsList = this.sortService.sortArrayByDate(allEvents.value).reverse();
this.eventoaprovacaostore.save(segment, this.eventsList)
} else {
this.eventoaprovacaostore.save(segment, [])
}
} else {
tracing.setAttribute('outcome', 'failed')
tracing.bugFlag()
if(!isHttpError(allEvents.error)) {
this.toastService._badRequest('Pedimos desculpa mas não foi possível executar a acção. Por favor, contacte o apoio técnico. #4')
}
if(allEvents.value.length >= 1) {
this.eventsList = this.sortService.sortArrayByDate(allEvents.value).reverse();
this.eventoaprovacaostore.save(segment, this.eventsList)
} else {
this.eventoaprovacaostore.save(segment, [])
}
this.showLoader = false;
} else {
tracing.setAttribute('outcome', 'failed')
tracing.bugFlag()
if(!isHttpError(allEvents.error)) {
this.toastService._badRequest('Pedimos desculpa mas não foi possível executar a acção. Por favor, contacte o apoio técnico. #4')
}
this.showLoader = false;
} else {
tracing.setAttribute('calling', 'early')
console.warn('calling to early Events-to-approve/LoadToApproveEvents')
}
this.showLoader = false;
}
getFromDB() {}