in frontend/src/app/home/home.component.ts [74:97]
groupingValAndKnownSql() {
this.homeService.setSelectedDbGrouping("");
this.groupingString = this.homeService.getAvailableDBList();
if (this.groupingString !== null && this.groupingString !== undefined) {
this.groupingsList = JSON.parse(this.groupingString);
this.homeService.currentSelectedGrouping.next('');
this.homeService.currentSelectedGroupingObservable.subscribe((res) => {
this.groupingsListCtrl.setValue(res);
if (!res) {
this.homeService.sqlSuggestionList("", "").subscribe((data: any) => {
if (data && data.ResponseCode === 200) {
this.homeService.knownSqlFromDb.next(data.KnownSQL);
}
})
}
})
} else {
this.homeService.getAvailableDatabases().subscribe((res: any) => {
if (res && res.ResponseCode === 200) {
this.groupingsList = JSON.parse(res.KnownDB);
}
});
}
}