1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-09 05:20:05 +00:00

chore(execute-script): improved code style

This commit is contained in:
Yury Shkoda
2023-05-04 12:21:22 +03:00
parent 2d6efa2437
commit 0f47326bb6

View File

@@ -133,19 +133,17 @@ export class SASjsApiClient {
authConfig?: AuthConfig
): Promise<ScriptExecutionResult> {
const access_token = await this.getAccessTokenForRequest(authConfig)
let executionResult: ScriptExecutionResult = { log: '' }
const executionResult: ScriptExecutionResult = { log: '' }
await this.requestClient
.post('SASjsApi/code/execute', { code, runTime }, access_token)
.then((res: any) => {
const { log, printOutput } = res
const webout = res.result
const { log, printOutput, result: webout } = res
executionResult.log = log
if (printOutput) executionResult = { ...executionResult, printOutput }
if (webout) executionResult = { ...executionResult, webout }
if (printOutput) executionResult.printOutput = printOutput
if (webout) executionResult.webout = webout
})
.catch((err) => {
throw prefixMessage(