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()
|
||||
export class ClassificationCategoriesService {
|
||||
private mainUrl = environment.taskanaRestUrl;
|
||||
private urlCategoriesByType = `${this.mainUrl}/v1/classifications-by-type`;
|
||||
|
||||
constructor(private httpClient: HttpClient) {}
|
||||
|
||||
// TODO: convert to Map (maybe via ES6)
|
||||
getClassificationCategoriesByType(): Observable<CategoriesResponse> {
|
||||
return this.httpClient.get<CategoriesResponse>(this.urlCategoriesByType);
|
||||
return this.httpClient.get<CategoriesResponse>(`${environment.taskanaRestUrl}/v1/classifications-by-type`);
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue