order by date

This commit is contained in:
tiago.kayaya
2021-10-18 13:58:26 +01:00
parent ba2c3c3543
commit 8b29af8599
16 changed files with 131 additions and 97 deletions
@@ -9,6 +9,7 @@ import { AlertService } from 'src/app/services/alert.service';
import { PedidoPage } from 'src/app/pages/gabinete-digital/pedidos/pedido/pedido.page';
import { PedidosStore } from 'src/app/store/pedidos-store.service';
import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
import { SortService } from 'src/app/services/functions/sort.service';
@Component({
selector: 'app-pedidos',
templateUrl: './pedidos.page.html',
@@ -43,6 +44,7 @@ export class PedidosPage implements OnInit {
private processes:ProcessesService,
private modalController: ModalController,
private alertService: AlertService,
private sortService: SortService,
) {
this.profile = 'mdgpr';
}
@@ -70,7 +72,7 @@ export class PedidosPage implements OnInit {
segmentChanged(ev: any) {
this.LoadList();
}
async LoadList() {
this.skeletonLoader = true;
@@ -92,7 +94,7 @@ export class PedidosPage implements OnInit {
let task: customTask = this.customTaskPipe.transform(element);
this.parecerList.push(task);
});
this.pedidosstore.resetparecer(this.parecerList);
this.pedidosstore.resetparecer(this.sortService.sortArrayByDate(this.parecerList));
}
else if(this.segment == 'deferimento') {
@@ -108,7 +110,7 @@ export class PedidosPage implements OnInit {
let task: customTask = this.customTaskPipe.transform(element);
this.deferimentoList.push(task);
});
this.pedidosstore.resetdeferimento(this.deferimentoList);
this.pedidosstore.resetdeferimento(this.sortService.sortArrayByDate(this.deferimentoList));
});
}