diff --git a/client/src/app/deploy/sections/automatic/automatic.component.ts b/client/src/app/deploy/sections/automatic/automatic.component.ts index 56af9e3..b06c37f 100644 --- a/client/src/app/deploy/sections/automatic/automatic.component.ts +++ b/client/src/app/deploy/sections/automatic/automatic.component.ts @@ -104,7 +104,7 @@ export class AutomaticComponent implements OnInit { const defaultContext = res.items.find( (item: ComputeContextItem) => - item.name === 'SAS Studio compute context' + item.name === 'SAS Job Execution compute context' ) if (defaultContext) { @@ -247,6 +247,20 @@ export class AutomaticComponent implements OnInit { ] } + // Get and run service using the selected context name + let selectedComputeContextName = this.sasJsConfig.contextName + + if (this.selectedComputeContext.length && this.computeContexts.length) { + const computeContext = this.computeContexts.find( + (context: ComputeContextItem) => + context.id === this.selectedComputeContext + ) + + if (computeContext) { + selectedComputeContextName = computeContext.name + } + } + /** * We are overriding default `sasjsConfig` object fields with this object fields. * Here we want to run this request using original WEB method. @@ -254,12 +268,12 @@ export class AutomaticComponent implements OnInit { */ let overrideConfig = { useComputeApi: null, - contextName: this.sasJsConfig.contextName, + contextName: selectedComputeContextName, debug: true } this.sasJs - .request(`services/admin/makedata`, data, overrideConfig, () => { + .request(`services/admin/makedata&_contextname=${selectedComputeContextName}`, data, overrideConfig, () => { this.sasService.shouldLogin.next(true) }) .then((res: any) => {