1
0
mirror of https://github.com/sasjs/server.git synced 2025-12-13 04:14:36 +00:00

fix: code/execute controller logic to handle different runtimes

This commit is contained in:
2022-06-17 20:01:50 +05:00
parent ab222cbaab
commit 23b6692f02
9 changed files with 114 additions and 64 deletions

View File

@@ -12,10 +12,15 @@ import {
interface ExecuteSASCodePayload {
/**
* Code of SAS program
* @example "* SAS Code HERE;"
* Code of program
* @example "* Code HERE;"
*/
code: string
/**
* runtime for program
* @example "js"
*/
runTime: RunTimeType
}
@Security('bearerAuth')
@@ -37,7 +42,7 @@ export class CodeController {
const executeSASCode = async (
req: express.Request,
{ code }: ExecuteSASCodePayload
{ code, runTime }: ExecuteSASCodePayload
) => {
const { user } = req
const userAutoExec =
@@ -53,7 +58,7 @@ const executeSASCode = async (
vars: { ...req.query, _debug: 131 },
otherArgs: { userAutoExec },
returnJson: true,
runTime: RunTimeType.SAS
runTime: runTime
})) as ExecuteReturnJson
return {