mirror of
https://github.com/sasjs/adapter.git
synced 2025-12-11 01:14:36 +00:00
Merge pull request #513 from sasjs/issue-508
fix: handle context name when it's undefined/null or empty string
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user