Skip to content

Commit

Permalink
TSK-1193: delayed initalisation of store until environment is set pro…
Browse files Browse the repository at this point in the history
…perly
  • Loading branch information
mustaphazorgati committed Apr 15, 2020
1 parent eef64bc commit 0154b05
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
Expand Down

0 comments on commit 0154b05

Please sign in to comment.