1
0
mirror of https://github.com/sasjs/server.git synced 2026-01-04 13:30:04 +00:00

style: lint

This commit is contained in:
2022-08-26 18:03:28 +02:00
parent eeba2328c0
commit 3b188cd724
2 changed files with 35 additions and 21 deletions

View File

@@ -14,14 +14,18 @@ mockSas9Router.get('/SASStoredProcess', async (req, res) => {
return
}
const filePath = path.join(process.cwd(), 'mocks', "generic", "sas9", "sas-stored-process")
const filePath = path.join(
process.cwd(),
'mocks',
'generic',
'sas9',
'sas-stored-process'
)
let file
try {
file = await readFile(
filePath
)
file = await readFile(filePath)
} catch (err: any) {
console.error(`Mocked file on path: ${filePath} is not found.`)
res.status(403).send(err.toString())
@@ -43,9 +47,7 @@ mockSas9Router.post('/SASStoredProcess/do/', async (req, res) => {
let file
try {
file = await readFile(
filePath
)
file = await readFile(filePath)
} catch (err: any) {
let err = `Mocked file on path: ${filePath} is not found.`
console.error(err)
@@ -82,12 +84,16 @@ mockSas9Router.post('/SASStoredProcess/do/', async (req, res) => {
if (MOCK_SERVERTYPE !== undefined) {
mockSas9Router.get('/SASLogon/login', async (req, res) => {
const filePath = path.join(process.cwd(), 'mocks', 'generic', 'sas9', 'login')
const filePath = path.join(
process.cwd(),
'mocks',
'generic',
'sas9',
'login'
)
try {
const file = await readFile(
filePath
)
const file = await readFile(filePath)
res.send(file)
} catch (err: any) {
@@ -98,12 +104,16 @@ if (MOCK_SERVERTYPE !== undefined) {
mockSas9Router.post('/SASLogon/login', async (req, res) => {
loggedIn = true
const filePath = path.join(process.cwd(), 'mocks', 'generic', 'sas9', 'logged-in')
const filePath = path.join(
process.cwd(),
'mocks',
'generic',
'sas9',
'logged-in'
)
try {
const file = await readFile(
filePath
)
const file = await readFile(filePath)
res.send(file)
} catch (err: any) {
@@ -114,12 +124,16 @@ if (MOCK_SERVERTYPE !== undefined) {
mockSas9Router.get('/SASLogon/logout', async (req, res) => {
loggedIn = false
const filePath = path.join(process.cwd(), 'mocks', 'generic', 'sas9', 'logged-out')
const filePath = path.join(
process.cwd(),
'mocks',
'generic',
'sas9',
'logged-out'
)
try {
const file = await readFile(
filePath
)
const file = await readFile(filePath)
res.send(file)
} catch (err: any) {