{"size": 764, "ext": "js", "max_stars_repo_path": "routes/categories.js", "max_stars_repo_name": "HungThinhIT/LearnVocabularyAPI", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "routes/categories.js", "max_issues_repo_name": "HungThinhIT/LearnVocabularyAPI", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "routes/categories.js", "max_forks_repo_name": "HungThinhIT/LearnVocabularyAPI", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 50.9333333333, "max_line_length": 101, "alphanum_fraction": 0.7866492147}
var express = require('express');
var router = express.Router();
//Require controller
const categoryController = require("../controllers/CategoryController");
//Require Middleware
const auth = require("../middleware/auth")
//Express-validator
const {validate} = require("../validates/validate.category")

router.get("/",auth, categoryController.getCategories)
router.get("/:categoryId", auth ,validate.getDetailCategory(), categoryController.getCardsInCategory)
router.post("/", auth, validate.create(), categoryController.createCategory)
router.patch("/:categoryId/name", auth, validate.changeName(), categoryController.changeCategoryName)
router.patch("/:categoryId/status", auth, validate.changeStatus(), categoryController.ChangeStatus)
module.exports = router