From 5df619b3f63571e8e326261d8114869d33881d91 Mon Sep 17 00:00:00 2001 From: Sabir Hassan Date: Fri, 3 Jun 2022 17:24:29 +0500 Subject: [PATCH] fix: pass _program to execute file without extension --- api/src/controllers/stp.ts | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/api/src/controllers/stp.ts b/api/src/controllers/stp.ts index 6a5d378..d3b01bf 100644 --- a/api/src/controllers/stp.ts +++ b/api/src/controllers/stp.ts @@ -131,15 +131,11 @@ const executeReturnRaw = async ( _program: string ): Promise => { 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 => { - 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