1
0
mirror of https://github.com/sasjs/adapter.git synced 2025-12-11 09:24:35 +00:00

Merge pull request #650 from sasjs/sasjs-server-webout

fix: no need to parse if webout is an object
This commit is contained in:
Muhammad Saad
2022-02-21 15:54:12 +04:00
committed by GitHub
2 changed files with 12 additions and 4 deletions

View File

@@ -65,8 +65,12 @@ export class SasJsJobExecutor extends BaseJobExecutor {
let jsonResponse = res.result
if (config.debug) {
const webout = parseWeboutResponse(res.result._webout, apiUrl)
jsonResponse = getValidJson(webout)
if (typeof res.result._webout === 'object') {
jsonResponse = res.result._webout
} else {
const webout = parseWeboutResponse(res.result._webout, apiUrl)
jsonResponse = getValidJson(webout)
}
} else {
jsonResponse = getValidJson(res.result._webout)
}

View File

@@ -178,8 +178,12 @@ export class WebJobExecutor extends BaseJobExecutor {
: res.result
break
case ServerType.Sasjs:
const webout = parseWeboutResponse(res.result._webout, apiUrl)
jsonResponse = getValidJson(webout)
if (typeof res.result._webout === 'object') {
jsonResponse = res.result._webout
} else {
const webout = parseWeboutResponse(res.result._webout, apiUrl)
jsonResponse = getValidJson(webout)
}
break
}
} else if (this.serverType === ServerType.Sasjs) {