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

fix: when contextName is falsy value, do not add it to apiUrl in web approach and fallback to default in jes approach

This commit is contained in:
2021-08-15 16:11:50 +05:00
parent 2b2b8e6429
commit bd03b2b06d
2 changed files with 11 additions and 1 deletions

View File

@@ -619,6 +619,11 @@ export default class SASjs {
authConfig
)
} else {
if (!config.contextName)
config = {
...config,
contextName: 'SAS Job Execution compute context'
}
return await this.jesJobExecutor!.execute(
sasJob,
data,

View File

@@ -54,7 +54,12 @@ export class WebJobExecutor extends BaseJobExecutor {
apiUrl += jobUri.length > 0 ? '&_job=' + jobUri : ''
apiUrl += config.contextName ? `&_contextname=${config.contextName}` : ''
// if context name exists and is not blank string
// then add _contextname variable in apiUrl
apiUrl +=
config.contextName && !/\s/.test(config.contextName)
? `&_contextname=${config.contextName}`
: ''
}
let requestParams = {