fix: makedata with context name
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user