1
0
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:
Yury Shkoda
2020-12-24 13:54:19 +03:00
parent d991ead86a
commit 8d155283dd
2 changed files with 4 additions and 7 deletions

View File

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

View File

@@ -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
)
}