mirror of
https://github.com/sasjs/adapter.git
synced 2026-01-04 11:10:05 +00:00
feat: parse response in webJobExecutor when server type is sasjs server
This commit is contained in:
@@ -113,6 +113,7 @@ export class WebJobExecutor extends BaseJobExecutor {
|
||||
const stringifiedData = JSON.stringify(data)
|
||||
if (
|
||||
config.serverType === ServerType.Sas9 ||
|
||||
config.serverType === ServerType.Sasjs ||
|
||||
stringifiedData.length > 500000 ||
|
||||
stringifiedData.includes(';')
|
||||
) {
|
||||
@@ -144,10 +145,23 @@ export class WebJobExecutor extends BaseJobExecutor {
|
||||
const requestPromise = new Promise((resolve, reject) => {
|
||||
this.requestClient!.post(apiUrl, formData, undefined)
|
||||
.then(async (res: any) => {
|
||||
this.requestClient!.appendRequest(res, sasJob, config.debug)
|
||||
|
||||
let jsonResponse = res.result
|
||||
|
||||
if (this.serverType === ServerType.Sasjs && config.debug) {
|
||||
this.requestClient!.appendRequest(
|
||||
jsonResponse,
|
||||
sasJob,
|
||||
config.debug
|
||||
)
|
||||
jsonResponse = JSON.parse(parseWeboutResponse(jsonResponse._webout))
|
||||
} else {
|
||||
this.requestClient!.appendRequest(res, sasJob, config.debug)
|
||||
}
|
||||
|
||||
if (this.serverType === ServerType.Sasjs && !config.debug) {
|
||||
jsonResponse = JSON.parse(jsonResponse._webout)
|
||||
}
|
||||
|
||||
if (config.debug) {
|
||||
switch (this.serverType) {
|
||||
case ServerType.SasViya:
|
||||
|
||||
Reference in New Issue
Block a user