mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
add synchro
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { customTask, fullTask } from '../models/dailyworktask.model';
|
||||
import { customTask, fullTask, fullTaskList } from '../models/dailyworktask.model';
|
||||
import { AttachmentList } from '../models/Excludetask';
|
||||
import { PermissionService } from '../OtherService/permission.service';
|
||||
import { CustomTaskPipe } from '../pipes/custom-task.pipe';
|
||||
@@ -189,7 +189,7 @@ export class DespachoService {
|
||||
}
|
||||
|
||||
|
||||
async getList({updateStore = false}): Promise<customTask[]> {
|
||||
async getList({updateStore = false}): Promise<customTask[]> | null {
|
||||
|
||||
if (this.LoaderService.loading) {
|
||||
return this.despachoStore.list
|
||||
@@ -197,35 +197,32 @@ export class DespachoService {
|
||||
|
||||
this.LoaderService.push({})
|
||||
|
||||
let result: fullTask[] = []
|
||||
let result: fullTaskList[] = []
|
||||
let despachoList: customTask[] = [];
|
||||
|
||||
try {
|
||||
result = await this.processes.GetTasksList("Despacho", false).toPromise();
|
||||
result = result.filter((data:fullTaskList) => data.workflowInstanceDataFields.Status == "Active")
|
||||
result.forEach((element, index) => {
|
||||
|
||||
let task: customTask = this.customTaskPipe.transform(element);
|
||||
despachoList.push(task);
|
||||
|
||||
});
|
||||
|
||||
despachoList = this.sortArrayISODate(despachoList).reverse();
|
||||
|
||||
if(updateStore) {
|
||||
this.despachoStore.reset(despachoList);
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
|
||||
} finally {
|
||||
this.LoaderService.pop({})
|
||||
}
|
||||
|
||||
|
||||
result = result.filter(data => data.workflowInstanceDataFields.Status == "Active")
|
||||
|
||||
let despachoList: customTask[] = new Array();
|
||||
|
||||
result.forEach((element, index) => {
|
||||
|
||||
let task: customTask = this.customTaskPipe.transform(element);
|
||||
despachoList.push(task);
|
||||
|
||||
});
|
||||
|
||||
despachoList = this.sortArrayISODate(despachoList).reverse();
|
||||
|
||||
if(updateStore) {
|
||||
this.despachoStore.reset(despachoList);
|
||||
return this.despachoStore.list
|
||||
}
|
||||
|
||||
return despachoList
|
||||
}
|
||||
|
||||
sortArrayISODate(myArray: any) {
|
||||
|
||||
Reference in New Issue
Block a user