* update v4 -> v7 done
This commit is contained in:
@@ -8,7 +8,7 @@ import { SimpleFault } from "./shared/simple-fault";
|
||||
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from "@angular/router";
|
||||
|
||||
@Injectable()
|
||||
export class FaultManagerService implements Resolve<Array<Fault>> {
|
||||
export class FaultManagerService implements Resolve<false|Array<Fault>> {
|
||||
|
||||
private apiEndpoint = environment.apiUrl + '/api/fault';
|
||||
private apiEndpointReject = environment.apiUrl + '/api/fault-reject';
|
||||
@@ -26,7 +26,7 @@ export class FaultManagerService implements Resolve<Array<Fault>> {
|
||||
* @param {RouterStateSnapshot} state
|
||||
* @returns {Promise<Array<Fault>>}
|
||||
*/
|
||||
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<Array<Fault>> {
|
||||
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<false|Array<Fault>> {
|
||||
return this.list().toPromise();
|
||||
}
|
||||
|
||||
|
||||
@@ -7,13 +7,13 @@ import { Fault } from "./shared/fault";
|
||||
import { environment } from "../../environments/environment";
|
||||
|
||||
@Injectable()
|
||||
export class FaultResolverService implements Resolve<Fault> {
|
||||
export class FaultResolverService implements Resolve<false|Fault> {
|
||||
private apiEndpoint = environment.apiUrl + '/api/fault';
|
||||
|
||||
constructor(private httpClient: HttpClient) {
|
||||
}
|
||||
|
||||
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<Fault> {
|
||||
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<false|Fault> {
|
||||
return this.getFault(route.params['id']).toPromise().then(result => result ? result : false);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,14 +8,14 @@ import { environment } from "../../../environments/environment";
|
||||
import { ErrorCategory } from "../shared";
|
||||
|
||||
@Injectable()
|
||||
export class ErrorCategoryService implements Resolve<Array<ErrorCategory>> {
|
||||
export class ErrorCategoryService implements Resolve<false|Array<ErrorCategory>> {
|
||||
|
||||
private url = environment.apiUrl + '/api/error-category';
|
||||
|
||||
constructor(private httpService: HttpClient) {
|
||||
}
|
||||
|
||||
public resolve(route: ActivatedRouteSnapshot): Promise<Array<ErrorCategory>> {
|
||||
public resolve(route: ActivatedRouteSnapshot): Promise<false|Array<ErrorCategory>> {
|
||||
return this.getList().toPromise().then(result => result ? result : false);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,14 +8,14 @@ import { environment } from "../../../environments/environment";
|
||||
import { ErrorOrigin } from "../shared/error-origin";
|
||||
|
||||
@Injectable()
|
||||
export class ErrorOriginService implements Resolve<Array<ErrorOrigin>> {
|
||||
export class ErrorOriginService implements Resolve<false|Array<ErrorOrigin>> {
|
||||
|
||||
private url = environment.apiUrl + '/api/error-origin';
|
||||
|
||||
constructor(private httpService: HttpClient) {
|
||||
}
|
||||
|
||||
public resolve(route: ActivatedRouteSnapshot): Promise<Array<ErrorOrigin>> {
|
||||
public resolve(route: ActivatedRouteSnapshot): Promise<false|Array<ErrorOrigin>> {
|
||||
return this.getList().toPromise().then(result => result ? result : false);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,14 +8,14 @@ import { environment } from "../../../environments/environment";
|
||||
import { FacilityLocation } from "../shared";
|
||||
|
||||
@Injectable()
|
||||
export class FacilityLocationService implements Resolve<Array<FacilityLocation>> {
|
||||
export class FacilityLocationService implements Resolve<false|Array<FacilityLocation>> {
|
||||
|
||||
private url = environment.apiUrl + '/api/facility-location';
|
||||
|
||||
constructor(private httpService: HttpClient) {
|
||||
}
|
||||
|
||||
public resolve(route: ActivatedRouteSnapshot): Promise<Array<FacilityLocation>> {
|
||||
public resolve(route: ActivatedRouteSnapshot): Promise<false|Array<FacilityLocation>> {
|
||||
return this.getList().toPromise().then(result => result ? result : false);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,14 +8,14 @@ import { environment } from "../../../environments/environment";
|
||||
import { SolutionTimeInterval } from "../shared/solution-time-interval";
|
||||
|
||||
@Injectable()
|
||||
export class SolutionTimeIntervalService implements Resolve<Array<SolutionTimeInterval>> {
|
||||
export class SolutionTimeIntervalService implements Resolve<false|Array<SolutionTimeInterval>> {
|
||||
|
||||
private url = environment.apiUrl + '/api/solution-time-interval';
|
||||
|
||||
constructor(private httpService: HttpClient) {
|
||||
}
|
||||
|
||||
public resolve(route: ActivatedRouteSnapshot): Promise<Array<SolutionTimeInterval>> {
|
||||
public resolve(route: ActivatedRouteSnapshot): Promise<false|Array<SolutionTimeInterval>> {
|
||||
return this.getList().toPromise().then(result => result ? result : false);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,14 +8,14 @@ import { User } from "./shared/user";
|
||||
import { AuthService } from "../auth/auth.service";
|
||||
|
||||
@Injectable()
|
||||
export class ProfileResolverService implements Resolve<User> {
|
||||
export class ProfileResolverService implements Resolve<false|User> {
|
||||
private apiEndpoint = environment.apiUrl + '/api/user';
|
||||
|
||||
constructor(private httpClient: HttpClient,
|
||||
private authService: AuthService) {
|
||||
}
|
||||
|
||||
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<User> {
|
||||
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<false|User> {
|
||||
return this.getProfile().toPromise().then(result => result ? result : false);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import { User } from "./shared/user";
|
||||
import { AuthService } from "../auth/auth.service";
|
||||
|
||||
@Injectable()
|
||||
export class UserService implements Resolve<Array<User>> {
|
||||
export class UserService implements Resolve<false|Array<User>> {
|
||||
private apiEndpoint = environment.apiUrl + '/api/user';
|
||||
private apiEndpointPassword = environment.apiUrl + '/api/user/password';
|
||||
|
||||
@@ -16,7 +16,7 @@ export class UserService implements Resolve<Array<User>> {
|
||||
private authService: AuthService) {
|
||||
}
|
||||
|
||||
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<Array<User>> {
|
||||
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<false|Array<User>> {
|
||||
return this.getUsers().toPromise().then(result => result ? result : false);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user