mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 09:28:06 +00:00
Begin action route for getting an action by id
This commit is contained in:
+1
-3
@@ -13,8 +13,7 @@ import { apiLimiter } from './helpers/rateLimiter';
|
|||||||
|
|
||||||
import {
|
import {
|
||||||
workspace as eeWorkspaceRouter,
|
workspace as eeWorkspaceRouter,
|
||||||
secret as eeSecretRouter,
|
secret as eeSecretRouter
|
||||||
log as eeLogRouter,
|
|
||||||
} from './ee/routes/v1';
|
} from './ee/routes/v1';
|
||||||
import {
|
import {
|
||||||
signup as v1SignupRouter,
|
signup as v1SignupRouter,
|
||||||
@@ -70,7 +69,6 @@ if (NODE_ENV === 'production') {
|
|||||||
// (EE) routes
|
// (EE) routes
|
||||||
app.use('/api/v1/secret', eeSecretRouter);
|
app.use('/api/v1/secret', eeSecretRouter);
|
||||||
app.use('/api/v1/workspace', eeWorkspaceRouter);
|
app.use('/api/v1/workspace', eeWorkspaceRouter);
|
||||||
app.use('/api/v1/log', eeLogRouter);
|
|
||||||
|
|
||||||
// v1 routes
|
// v1 routes
|
||||||
app.use('/api/v1/signup', v1SignupRouter);
|
app.use('/api/v1/signup', v1SignupRouter);
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
import { Request, Response } from 'express';
|
||||||
|
import * as Sentry from '@sentry/node';
|
||||||
|
import { Action } from '../../models';
|
||||||
|
|
||||||
|
export const getAction = (req: Request, res: Response) => {
|
||||||
|
let action;
|
||||||
|
// try {
|
||||||
|
// const { actionId } = req.params;
|
||||||
|
|
||||||
|
// action = await Action.findById(actionId);
|
||||||
|
|
||||||
|
|
||||||
|
// } catch (err) {
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
return res.status(200).send({
|
||||||
|
action
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
import * as stripeController from './stripeController';
|
import * as stripeController from './stripeController';
|
||||||
import * as secretController from './secretController';
|
import * as secretController from './secretController';
|
||||||
import * as workspaceController from './workspaceController';
|
import * as workspaceController from './workspaceController';
|
||||||
|
import * as actionController from './actionController';
|
||||||
|
|
||||||
export {
|
export {
|
||||||
stripeController,
|
stripeController,
|
||||||
secretController,
|
secretController,
|
||||||
workspaceController
|
workspaceController,
|
||||||
|
actionController
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import express from 'express';
|
||||||
|
const router = express.Router();
|
||||||
|
import {
|
||||||
|
validateRequest
|
||||||
|
} from '../../../middleware';
|
||||||
|
import { param } from 'express-validator';
|
||||||
|
import { actionController } from '../../controllers/v1';
|
||||||
|
|
||||||
|
// TODO: put into action controller
|
||||||
|
router.get(
|
||||||
|
'/:actionId',
|
||||||
|
param('actionId').exists().trim(),
|
||||||
|
validateRequest,
|
||||||
|
actionController.getAction
|
||||||
|
);
|
||||||
|
|
||||||
|
export default router;
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
import secret from './secret';
|
import secret from './secret';
|
||||||
import workspace from './workspace';
|
import workspace from './workspace';
|
||||||
import log from './log';
|
import action from './action';
|
||||||
|
|
||||||
export {
|
export {
|
||||||
secret,
|
secret,
|
||||||
workspace,
|
workspace,
|
||||||
log
|
action
|
||||||
}
|
}
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
import express from 'express';
|
|
||||||
const router = express.Router();
|
|
||||||
|
|
||||||
export default router;
|
|
||||||
Reference in New Issue
Block a user