fix: sas viya service init timing issue
This commit is contained in:
@@ -62,14 +62,24 @@ export class SasViyaService {
|
||||
private http: HttpClient,
|
||||
private appStoreService: AppStoreService
|
||||
) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is replacing the constructor.
|
||||
* The reason for this is timing issues, other services eg. sas.service, app-store.service
|
||||
* must be initialized before this bit of code is executed.
|
||||
* This function is being called by `sas.service`
|
||||
*/
|
||||
setup() {
|
||||
const adapterConfig = this.appStoreService.getDcAdapterSettings()
|
||||
|
||||
this.serverUrl = adapterConfig?.serverUrl || ''
|
||||
|
||||
//example
|
||||
this.getByCollection('jobs').subscribe((res) => {
|
||||
console.log('res', res)
|
||||
})
|
||||
//example collection request
|
||||
// this.getByCollection('jobs').subscribe((res) => {
|
||||
// console.log('res', res)
|
||||
// })
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -55,6 +55,7 @@ export class SasService {
|
||||
this.dcAdapterSettings = this.appStoreService.getDcAdapterSettings()
|
||||
|
||||
this.sasjsService.setup()
|
||||
this.sasViyaService.setup()
|
||||
|
||||
if (!this.dcAdapterSettings) {
|
||||
this.eventService.showInfoModal(
|
||||
|
||||
Reference in New Issue
Block a user