fix: makedata with context name
Some checks failed
Build / Build-and-ng-test (pull_request) Failing after 49s
Build / Build-and-test-development (pull_request) Successful in 8m32s

This commit is contained in:
Mihajlo Medjedovic
2025-06-03 21:00:54 +02:00
parent 6c96ef7fb0
commit da4d0b28c7

View File

@@ -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) => {