mirror of
https://github.com/sasjs/adapter.git
synced 2025-12-15 18:54:36 +00:00
fix(context): fixed executeScript method
This commit is contained in:
@@ -325,7 +325,6 @@ export class ContextManager {
|
||||
executeScript: Function,
|
||||
accessToken?: string
|
||||
) {
|
||||
console.log(`[324]`, 324)
|
||||
const headers: any = {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
@@ -344,13 +343,11 @@ export class ContextManager {
|
||||
const contextsList = contexts.items || []
|
||||
const executableContexts: any[] = []
|
||||
|
||||
console.log(`[this.sasViyaApiClient]`, this.sasViyaApiClient)
|
||||
|
||||
const promises = contextsList.map((context: any) => {
|
||||
const linesOfCode = ['%put &=sysuserid;']
|
||||
|
||||
return () =>
|
||||
this.sasViyaApiClient!.executeScript(
|
||||
executeScript(
|
||||
`test-${context.name}`,
|
||||
linesOfCode,
|
||||
context.name,
|
||||
@@ -366,8 +363,6 @@ export class ContextManager {
|
||||
|
||||
for (const promise of promises) results.push(await promise())
|
||||
|
||||
console.log(`[results]`, results)
|
||||
|
||||
results.forEach((result: any, index: number) => {
|
||||
if (result && result.log) {
|
||||
try {
|
||||
|
||||
@@ -117,8 +117,10 @@ export class SASViyaApiClient {
|
||||
* @param accessToken - an access token for an authorized user.
|
||||
*/
|
||||
public async getExecutableContexts(accessToken?: string) {
|
||||
const bindedExecuteScript = this.executeScript.bind(this)
|
||||
|
||||
return await this.contextManager.getExecutableContexts(
|
||||
this.executeScript,
|
||||
bindedExecuteScript,
|
||||
accessToken
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user