Skip to content
Snippets Groups Projects
Commit 72734802 authored by OZGCloud's avatar OZGCloud
Browse files

Merge pull request 'OZG-4292 avoid unnecessary call' (#323) from...

Merge pull request 'OZG-4292 avoid unnecessary call' (#323) from OZG-4292-FehlschlagendeCallsVorgangListe into master

Reviewed-on: https://git.ozg-sh.de/mgm/goofy/pulls/323


Reviewed-by: default avatarOZGCloud <ozgcloud@mgm-tp.com>
parents 85df8bbe 27caea77
Branches
Tags
No related merge requests found
......@@ -210,9 +210,9 @@ describe('VorgangListService', () => {
expect(vorgangFacade.getVorgangStatistic).toHaveBeenCalled();
})
it('should getVorgangList', (done) => {
service.getVorgangStatistic().subscribe(() => {
expect(service.getVorgangList).toHaveBeenCalled();
it('should return vorgangStatistic', (done) => {
service.getVorgangStatistic().subscribe(vorgangStatistic => {
expect(vorgangStatistic).toEqual(vorgangStatisticStateResource);
done();
})
})
......
......@@ -23,9 +23,9 @@
*/
import { Injectable } from '@angular/core';
import { ApiRootFacade, ApiRootResource } from '@goofy-client/api-root-shared';
import { EMPTY_STRING, StateResource, createEmptyStateResource, doIfLoadingRequired, isLoaded, isNotNull } from '@goofy-client/tech-shared';
import { EMPTY_STRING, StateResource, createEmptyStateResource, doIfLoadingRequired, isNotNull } from '@goofy-client/tech-shared';
import { Observable, combineLatest } from 'rxjs';
import { filter, map, startWith, tap, withLatestFrom } from 'rxjs/operators';
import { map, startWith, tap, withLatestFrom } from 'rxjs/operators';
import { VorgangFacade } from './+state/vorgang.facade';
import { ROUTE_PARAM_BY_VORGANG_FILTER, buildLinkRel, getSearchLinkRel } from './vorgang-navigation.util';
import { VorgangFilter, VorgangListResource, VorgangResource, VorgangStatistic, VorgangView } from './vorgang.model';
......@@ -64,11 +64,7 @@ export class VorgangListService {
}
public getVorgangStatistic(): Observable<StateResource<VorgangStatistic>> {
return this.vorgangFacade.getVorgangStatistic().pipe(
withLatestFrom(this.getVorgangList()),
filter(([, vorgangListResource]) => isLoaded(vorgangListResource)),
map(([statistic,]) => statistic),
);
return this.vorgangFacade.getVorgangStatistic();
}
public getSelectedFilterAsRouteParam(): Observable<string> {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment