mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
fix loader
This commit is contained in:
@@ -19,7 +19,8 @@ import { Router } from '@angular/router';
|
||||
import { v4 as uuidv4 } from 'uuid'
|
||||
import { ChangeProfileService } from './change-profile.service';
|
||||
import { PermissionService } from './permission.service';
|
||||
|
||||
import { AgendaDataRepositoryService } from 'src/app/services/Repositorys/Agenda/agenda-data-repository.service';
|
||||
import { SortService } from './functions/sort.service';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
@@ -67,6 +68,8 @@ export class TaskService {
|
||||
private router: Router,
|
||||
private changeProfileService: ChangeProfileService,
|
||||
public p: PermissionService,
|
||||
public AgendaDataRepositoryService: AgendaDataRepositoryService,
|
||||
private sortService: SortService,
|
||||
) {
|
||||
|
||||
this.changeProfileService.registerCallback(() => {
|
||||
@@ -315,30 +318,26 @@ export class TaskService {
|
||||
/* if(this.SessionStore.user.Profile != 'PR') { */
|
||||
try {
|
||||
for(let calendar of this.eventService.calendarNamesAry) {
|
||||
if(calendar == 'Meu calendario') {
|
||||
// color
|
||||
let genericEvents = await this.processesbackend.eventsToApprove(SessionStore.user.UserId, false).toPromise();
|
||||
let eventsList
|
||||
try {
|
||||
eventsList = genericEvents
|
||||
} catch (error) {
|
||||
eventsList = [];
|
||||
}
|
||||
|
||||
console.log(calendar, eventsList)
|
||||
this.eventoaprovacaostore.save(calendar, eventsList)
|
||||
let userId;
|
||||
|
||||
if(calendar == 'Meu calendario') {
|
||||
userId = SessionStore.user.UserId
|
||||
|
||||
} else {
|
||||
let allEvents = await this.processesbackend.eventsToApprove(calendar.OwnerUserId, 'againete page').toPromise()
|
||||
let eventsList
|
||||
try {
|
||||
eventsList = allEvents
|
||||
} catch(error) {
|
||||
eventsList = []
|
||||
}
|
||||
userId = calendar.OwnerUserId
|
||||
}
|
||||
|
||||
console.log(calendar, eventsList)
|
||||
this.eventoaprovacaostore.save(calendar.OwnerUserId, eventsList)
|
||||
let allEvents = await this.AgendaDataRepositoryService.eventToApproveList({userId})
|
||||
if(allEvents.isOk()) {
|
||||
|
||||
let eventsList = []
|
||||
if(allEvents.value.length >= 1) {
|
||||
eventsList = this.sortService.sortArrayByDate(allEvents.value).reverse();
|
||||
this.eventoaprovacaostore.save(userId, eventsList)
|
||||
} else {
|
||||
this.eventoaprovacaostore.save(userId, [])
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user