Skip to content

Commit

Permalink
use getCluster as part of the routes (#43)
Browse files Browse the repository at this point in the history
also, don't call getCluster on the /api/v2/clusters route
  • Loading branch information
dalehille authored and geoffcorey committed Jun 6, 2019
1 parent 620e0f4 commit ad66f02
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/routes/v2/clusters.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,15 +212,14 @@ const addClusterMessages = async (req, res, next) => {


router.use(ebl(getBunyanConfig('razeedash-api/clusters')));
router.use(getCluster); // adds req.cluster object and validates org_id/cluster_id ownership

// /api/v2/clusters/:cluster_id
router.post('/:cluster_id', asyncHandler(addUpdateCluster));

// /api/v2/clusters/:cluster_id/resources
router.post('/:cluster_id/resources', asyncHandler(updateClusterResources));
router.post('/:cluster_id/resources', asyncHandler(getCluster), asyncHandler(updateClusterResources));

// /api/v2/clusters/:cluster_id/messages
router.post('/:cluster_id/messages', asyncHandler(addClusterMessages));
router.post('/:cluster_id/messages', asyncHandler(getCluster), asyncHandler(addClusterMessages));

module.exports = router;

0 comments on commit ad66f02

Please sign in to comment.