1
0
mirror of https://github.com/sasjs/adapter.git synced 2025-12-11 01:14:36 +00:00

fix: check for valid json while parsing sas viya debug response

This commit is contained in:
2021-08-18 00:04:30 +05:00
parent 0bc69401e5
commit 8464e506e0
2 changed files with 3 additions and 4 deletions

View File

@@ -75,9 +75,7 @@ export class FileUploader {
this.requestClient,
this.sasjsConfig.serverUrl
)
return typeof jsonResponse === 'string'
? getValidJson(jsonResponse)
: jsonResponse
return jsonResponse
}
return typeof res.result === 'string'

View File

@@ -1,4 +1,5 @@
import { RequestClient } from '../request/RequestClient'
import { getValidJson } from '../utils'
/**
* When querying a Viya job using the Web approach (as opposed to using the APIs) with _DEBUG enabled,
@@ -25,5 +26,5 @@ export const parseSasViyaDebugResponse = async (
return requestClient
.get(serverUrl + jsonUrl, undefined)
.then((res) => res.result)
.then((res: any) => getValidJson(res.result))
}