Skip to content

Commit 0154b05

Browse files
TSK-1193: delayed initalisation of store until environment is set properly
1 parent eef64bc commit 0154b05

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

web/src/app/shared/services/classifications/classification-categories.service.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,11 @@ export interface CategoriesResponse { [key: string]: string[] }
1515

1616
@Injectable()
1717
export class ClassificationCategoriesService {
18-
private mainUrl = environment.taskanaRestUrl;
19-
private urlCategoriesByType = `${this.mainUrl}/v1/classifications-by-type`;
20-
2118
constructor(private httpClient: HttpClient) {}
2219

2320
// TODO: convert to Map (maybe via ES6)
2421
getClassificationCategoriesByType(): Observable<CategoriesResponse> {
25-
return this.httpClient.get<CategoriesResponse>(this.urlCategoriesByType);
22+
return this.httpClient.get<CategoriesResponse>(`${environment.taskanaRestUrl}/v1/classifications-by-type`);
2623
}
2724

2825
getCustomisation(): Observable<Customisation> {

web/src/app/store/classification-store/classification.state.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ export class ClassificationState {
3434
);
3535
}
3636

37-
ngxsOnInit(ctx: StateContext<ClassificationStateModel>): void {
37+
// initialize after Startup service has configured the taskanaRestUrl properly.
38+
ngxsAfterBootstrap(ctx: StateContext<ClassificationStateModel>): void {
3839
ctx.dispatch(new InitializeStore());
3940
}
4041
}

0 commit comments

Comments
 (0)