mirror of
https://github.com/sasjs/adapter.git
synced 2026-01-08 13:00:05 +00:00
chore(execute-script): improved code style
This commit is contained in:
@@ -133,19 +133,17 @@ export class SASjsApiClient {
|
|||||||
authConfig?: AuthConfig
|
authConfig?: AuthConfig
|
||||||
): Promise<ScriptExecutionResult> {
|
): Promise<ScriptExecutionResult> {
|
||||||
const access_token = await this.getAccessTokenForRequest(authConfig)
|
const access_token = await this.getAccessTokenForRequest(authConfig)
|
||||||
|
const executionResult: ScriptExecutionResult = { log: '' }
|
||||||
let executionResult: ScriptExecutionResult = { log: '' }
|
|
||||||
|
|
||||||
await this.requestClient
|
await this.requestClient
|
||||||
.post('SASjsApi/code/execute', { code, runTime }, access_token)
|
.post('SASjsApi/code/execute', { code, runTime }, access_token)
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
const { log, printOutput } = res
|
const { log, printOutput, result: webout } = res
|
||||||
const webout = res.result
|
|
||||||
|
|
||||||
executionResult.log = log
|
executionResult.log = log
|
||||||
|
|
||||||
if (printOutput) executionResult = { ...executionResult, printOutput }
|
if (printOutput) executionResult.printOutput = printOutput
|
||||||
if (webout) executionResult = { ...executionResult, webout }
|
if (webout) executionResult.webout = webout
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
throw prefixMessage(
|
throw prefixMessage(
|
||||||
|
|||||||
Reference in New Issue
Block a user