1
0
mirror of https://github.com/sasjs/server.git synced 2025-12-10 11:24:35 +00:00

fix: pass _program to execute file without extension

This commit is contained in:
2022-06-03 17:24:29 +05:00
parent 07295aa151
commit 5df619b3f6

View File

@@ -131,15 +131,11 @@ const executeReturnRaw = async (
_program: string
): Promise<string | Buffer> => {
const query = req.query as ExecutionVars
const sasCodePath =
path
.join(getFilesFolder(), _program)
.replace(new RegExp('/', 'g'), path.sep) + '.sas'
try {
const { result, httpHeaders } =
(await new ExecutionController().executeFile(
sasCodePath,
_program,
getPreProgramVariables(req),
query
)) as ExecuteReturnRaw
@@ -171,11 +167,6 @@ const executeReturnJson = async (
req: express.Request,
_program: string
): Promise<ExecuteReturnJsonResponse> => {
const sasCodePath =
path
.join(getFilesFolder(), _program)
.replace(new RegExp('/', 'g'), path.sep) + '.sas'
const filesNamesMap = req.files?.length
? makeFilesNamesMap(req.files as MulterFile[])
: null
@@ -183,12 +174,12 @@ const executeReturnJson = async (
try {
const { webout, log, httpHeaders } =
(await new ExecutionController().executeFile(
sasCodePath,
_program,
getPreProgramVariables(req),
{ ...req.query, ...req.body },
{ filesNamesMap: filesNamesMap },
true,
req.sasSession
req.sasjsSession
)) as ExecuteReturnJson
let weboutRes: string | IRecordOfAny = webout