1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-02 02:00:06 +00:00

fix(context): fixed 'getExecutableContexts' method

This commit is contained in:
Yury Shkoda
2020-10-07 17:25:47 +03:00
parent bd8012fe3e
commit 94967b0f6c

View File

@@ -152,24 +152,25 @@ export class SASViyaApiClient {
accessToken,
null,
true
).catch(() => null)
).catch((err) => err)
})
const results = await Promise.all(promises)
results.forEach((result: any, index: number) => {
if (result) {
if (result && result.body && result.body.details) {
try {
const resultParsed = JSON.parse(result.body.details)
if (resultParsed && resultParsed.body) {
let sysUserId = ''
if (result.log) {
const sysUserIdLog = result.log
const sysUserIdLog = resultParsed.body
.split('\n')
.find((line: string) => line.startsWith('SYSUSERID='))
if (sysUserIdLog) {
sysUserId = sysUserIdLog.replace('SYSUSERID=', '')
}
}
executableContexts.push({
createdBy: contextsList[index].createdBy,
@@ -181,6 +182,11 @@ export class SASViyaApiClient {
}
})
}
}
} catch (error) {
throw error
}
}
})
return executableContexts