1
0
mirror of https://github.com/sasjs/server.git synced 2026-01-11 00:10:06 +00:00

chore(code): updated route to code/execute

This commit is contained in:
Saad Jutt
2021-12-21 14:24:27 +05:00
parent e1eb04494a
commit e6e5a5fd64
5 changed files with 19 additions and 19 deletions

View File

@@ -1,17 +1,17 @@
import express from 'express'
import { runSASValidation } from '../../utils'
import { RUNController } from '../../controllers/'
import { CodeController } from '../../controllers/'
const runRouter = express.Router()
const controller = new RUNController()
const controller = new CodeController()
runRouter.post('/code', async (req, res) => {
const { error, value: body } = runSASValidation(req.body)
if (error) return res.status(400).send(error.details[0].message)
try {
const response = await controller.runSAS(req, body)
const response = await controller.executeSASCode(req, body)
res.send(response)
} catch (err: any) {
const statusCode = err.code

View File

@@ -11,7 +11,7 @@ import {
import driveRouter from './drive'
import stpRouter from './stp'
import runRouter from './run'
import codeRouter from './code'
import userRouter from './user'
import groupRouter from './group'
import clientRouter from './client'
@@ -32,7 +32,7 @@ router.use(
router.use('/drive', authenticateAccessToken, driveRouter)
router.use('/group', desktopRestrict, groupRouter)
router.use('/stp', authenticateAccessToken, stpRouter)
router.use('/run', authenticateAccessToken, runRouter)
router.use('/code', authenticateAccessToken, codeRouter)
router.use('/user', desktopRestrict, userRouter)
router.use(
'/',