Skip to content

Commit

Permalink
updated category routes
Browse files Browse the repository at this point in the history
  • Loading branch information
byohannes committed Oct 29, 2020
1 parent b3ca8fc commit dd1ffd9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions routes/category.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const express = require("express");
const router = express.Router();
const { requireSignin, isAuth, isAdmin } = require("../controllers/auth");

const {
create,
categoryById,
Expand All @@ -9,25 +9,28 @@ const {
remove,
list,
} = require("../controllers/category");
const { requireSignin, isAuth, isAdmin } = require("../controllers/auth");
const { userById } = require("../controllers/user");

router.get("/category/:categoryId", read);
router.get("/categories", list);
router.post("/category/create/:userId", requireSignin, isAuth, isAdmin, create);
// router.put('/category/:categoryUpdateId/:userId', requireSignin, isAuth, isAdmin, update);
router.put(
"/category/:categoryId/:userId",
requireSignin,
isAuth,
isAdmin,
update
);

router.delete(
"/category/:categoryId/:userId",
requireSignin,
isAuth,
isAdmin,
remove
);
router.get("/categories", list);

router.param("categoryId", categoryById);
router.param("userId", userById);
Expand Down

0 comments on commit dd1ffd9

Please sign in to comment.