TSK-1193: delayed initalisation of store until environment is set properly
This commit is contained in:
parent
eef64bc1b3
commit
0154b0510e
|
|
@ -15,14 +15,11 @@ export interface CategoriesResponse { [key: string]: string[] }
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class ClassificationCategoriesService {
|
export class ClassificationCategoriesService {
|
||||||
private mainUrl = environment.taskanaRestUrl;
|
|
||||||
private urlCategoriesByType = `${this.mainUrl}/v1/classifications-by-type`;
|
|
||||||
|
|
||||||
constructor(private httpClient: HttpClient) {}
|
constructor(private httpClient: HttpClient) {}
|
||||||
|
|
||||||
// TODO: convert to Map (maybe via ES6)
|
// TODO: convert to Map (maybe via ES6)
|
||||||
getClassificationCategoriesByType(): Observable<CategoriesResponse> {
|
getClassificationCategoriesByType(): Observable<CategoriesResponse> {
|
||||||
return this.httpClient.get<CategoriesResponse>(this.urlCategoriesByType);
|
return this.httpClient.get<CategoriesResponse>(`${environment.taskanaRestUrl}/v1/classifications-by-type`);
|
||||||
}
|
}
|
||||||
|
|
||||||
getCustomisation(): Observable<Customisation> {
|
getCustomisation(): Observable<Customisation> {
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,8 @@ export class ClassificationState {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
ngxsOnInit(ctx: StateContext<ClassificationStateModel>): void {
|
// initialize after Startup service has configured the taskanaRestUrl properly.
|
||||||
|
ngxsAfterBootstrap(ctx: StateContext<ClassificationStateModel>): void {
|
||||||
ctx.dispatch(new InitializeStore());
|
ctx.dispatch(new InitializeStore());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue