All files / projects/organization-management/src/app/guards fetch-cost-centers.guard.ts

100% Statements 8/8
100% Branches 0/0
100% Functions 1/1
100% Lines 8/8

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1626x 26x 26x   26x         26x 13x   13x 13x    
import { inject } from '@angular/core';
import { Store } from '@ngrx/store';
import { Observable, of } from 'rxjs';
 
import { loadCostCenters } from '../store/cost-centers';
 
/**
 * Fetch cost centers for cost center management page
 */
export function fetchCostCentersGuard(): boolean | Observable<boolean> {
  const store = inject(Store);
 
  store.dispatch(loadCostCenters());
  return of(true);
}