Remove duplicate api calls

This commit is contained in:
Peter Maquiran
2021-08-18 12:17:02 +01:00
parent 1fbb308831
commit d3e18efcd5
15 changed files with 7 additions and 34 deletions
@@ -68,7 +68,6 @@ export class DespachosPrPage implements OnInit {
const location = window.location const location = window.location
const pathname = location.pathname + location.search const pathname = location.pathname + location.search
this.LoadList();
this.router.events.forEach((event) => { this.router.events.forEach((event) => {
if (event instanceof NavigationStart && event.url.startsWith(pathname)) { if (event instanceof NavigationStart && event.url.startsWith(pathname)) {
@@ -56,7 +56,6 @@ export class DespachosPage implements OnInit {
const location = window.location const location = window.location
const pathname = location.pathname + location.search const pathname = location.pathname + location.search
this.LoadList();
this.router.events.forEach((event) => { this.router.events.forEach((event) => {
if (event instanceof NavigationStart && event.url.startsWith(pathname)) { if (event instanceof NavigationStart && event.url.startsWith(pathname)) {
@@ -37,7 +37,6 @@ export class DiplomasAssinarPage implements OnInit {
ngOnInit() { ngOnInit() {
const location = window.location const location = window.location
const pathname = location.pathname + location.search const pathname = location.pathname + location.search
this.LoadList();
this.router.events.forEach((event) => { this.router.events.forEach((event) => {
if (event instanceof NavigationEnd && event.url.startsWith(pathname)) { if (event instanceof NavigationEnd && event.url.startsWith(pathname)) {
@@ -43,7 +43,6 @@ constructor(
const location = window.location const location = window.location
const pathname = location.pathname + location.search const pathname = location.pathname + location.search
this.LoadList();
this.router.events.forEach((event) => { this.router.events.forEach((event) => {
if (event instanceof NavigationStart && event.url.startsWith(pathname)) { if (event instanceof NavigationStart && event.url.startsWith(pathname)) {
@@ -42,7 +42,6 @@ export class EventListPage implements OnInit {
const location = window.location const location = window.location
const pathname = location.pathname + location.search const pathname = location.pathname + location.search
this.LoadToApproveEvents();
this.router.events.forEach((event) => { this.router.events.forEach((event) => {
if (event instanceof NavigationStart && event.url.startsWith(pathname)) { if (event instanceof NavigationStart && event.url.startsWith(pathname)) {
@@ -38,8 +38,6 @@ export class ExpedientePage implements OnInit {
const location = window.location const location = window.location
const pathname = location.pathname + location.search const pathname = location.pathname + location.search
this.LoadList();
this.router.events.forEach((event) => { this.router.events.forEach((event) => {
if (event instanceof NavigationStart && event.url.startsWith(pathname)) { if (event instanceof NavigationStart && event.url.startsWith(pathname)) {
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) { if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
@@ -47,8 +47,6 @@ export class ExpedientesPrPage implements OnInit {
const location = window.location const location = window.location
const pathname = location.pathname + location.search const pathname = location.pathname + location.search
this.LoadList();
this.router.events.forEach((event) => { this.router.events.forEach((event) => {
if (event instanceof NavigationStart && event.url.startsWith(pathname)) { if (event instanceof NavigationStart && event.url.startsWith(pathname)) {
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) { if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
@@ -53,8 +53,6 @@ export class PedidosPage implements OnInit {
ngOnInit() { ngOnInit() {
this.LoadList();
this.router.events.forEach((event) => { this.router.events.forEach((event) => {
if(event instanceof NavigationStart && '/home/gabinete-digital/pedidos?parecer=true'.startsWith(event.url) || if(event instanceof NavigationStart && '/home/gabinete-digital/pedidos?parecer=true'.startsWith(event.url) ||
event instanceof NavigationStart && '/home/gabinete-digital/pedidos?deferimento=true'.startsWith(event.url) event instanceof NavigationStart && '/home/gabinete-digital/pedidos?deferimento=true'.startsWith(event.url)
@@ -16,12 +16,11 @@ import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
}) })
export class DespachosPrPage implements OnInit { export class DespachosPrPage implements OnInit {
customTaskPipe = new CustomTaskPipe() customTaskPipe = new CustomTaskPipe()
skeletonLoader = true skeletonLoader = true
loggeduser: User;
loggeduser: User; despachosprstore = DespachosprStore;
despachosprstore = DespachosprStore;
constructor ( constructor (
private processes:ProcessesService, private processes:ProcessesService,
@@ -34,8 +33,6 @@ constructor (
ngOnInit() { ngOnInit() {
this.LoadList();
this.router.events.forEach((event) => { this.router.events.forEach((event) => {
if (event instanceof NavigationStart && if (event instanceof NavigationStart &&
event.url.startsWith('/home/gabinete-digital?despachospr=true')) { event.url.startsWith('/home/gabinete-digital?despachospr=true')) {
@@ -29,8 +29,6 @@ export class DiplomasAssinarPage implements OnInit {
) { } ) { }
ngOnInit() { ngOnInit() {
// update list
this.LoadList();
this.router.events.forEach((event) => { this.router.events.forEach((event) => {
if (event instanceof NavigationStart && '/home/gabinete-digital?diplomasassinar=true'.startsWith(event.url)) { if (event instanceof NavigationStart && '/home/gabinete-digital?diplomasassinar=true'.startsWith(event.url)) {
@@ -39,10 +39,6 @@ constructor(
ngOnInit() { ngOnInit() {
// update list // update list
this.LoadList();
// update list
const location = window.location
const pathname = location.pathname + location.search
this.router.events.forEach((event) => { this.router.events.forEach((event) => {
if (event instanceof NavigationStart && '/home/gabinete-digital?diplomas=true'.startsWith(event.url)) { if (event instanceof NavigationStart && '/home/gabinete-digital?diplomas=true'.startsWith(event.url)) {
@@ -39,8 +39,6 @@ export class ExpedientesPrPage implements OnInit {
ngOnInit() { ngOnInit() {
this.LoadList();
this.router.events.forEach((event) => { this.router.events.forEach((event) => {
if (event instanceof NavigationStart && if (event instanceof NavigationStart &&
event.url.startsWith('/home/gabinete-digital?expedientespr=true') || event.url.startsWith('/home/gabinete-digital?expedientespr=true') ||
@@ -43,7 +43,6 @@ export class ExpedientsPage implements OnInit {
ngOnInit() { ngOnInit() {
//Inicializar segment //Inicializar segment
this.segment = "expedientes"; this.segment = "expedientes";
this.LoadList();
this.router.events.forEach((event) => { this.router.events.forEach((event) => {
if (event instanceof NavigationStart && if (event instanceof NavigationStart &&
@@ -50,7 +50,6 @@ export class PedidosPage implements OnInit {
ngOnInit() { ngOnInit() {
this.LoadList();
this.router.events.forEach((event) => { this.router.events.forEach((event) => {
if(event instanceof NavigationStart && '/home/gabinete-digital?parecer=true'.startsWith(event.url) || if(event instanceof NavigationStart && '/home/gabinete-digital?parecer=true'.startsWith(event.url) ||
@@ -34,9 +34,6 @@ export class PendentesPage implements OnInit {
ngOnInit() { ngOnInit() {
// update list
this.LoadList();
this.router.events.forEach((event) => { this.router.events.forEach((event) => {
if (event instanceof NavigationStart && if (event instanceof NavigationStart &&
event.url.startsWith('/home/gabinete-digital?pendentes=true')) { event.url.startsWith('/home/gabinete-digital?pendentes=true')) {