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

fix: refactor code in preUploadMiddleware function

This commit is contained in:
2022-06-06 17:23:09 +05:00
parent dffe6d7121
commit 6d6bda5626

View File

@@ -33,19 +33,18 @@ export class FileUploadController {
runTime
if (await fileExists(codePath)) {
let sessionController
if (runTime === SASJSRunTimes.JS) {
const sessionController = getJSSessionController()
const session = await sessionController.getSession()
req.sasjsSession = session
sessionController = getJSSessionController()
} else {
const sessionController = getSASSessionController()
const session = await sessionController.getSession()
// marking consumed true, so that it's not available
// as readySession for any other request
session.consumed = true
req.sasjsSession = session
sessionController = getSASSessionController()
}
const session = await sessionController.getSession()
// marking consumed true, so that it's not available
// as readySession for any other request
session.consumed = true
req.sasjsSession = session
break
}
}