| 1 | import { Router } from "express"; |
| 2 | import * as tagController from "./tagsController"; |
| 3 | import { authenticateToken, validateRequest } from "../../../shared/middleware"; |
| 4 | import { createTagSchema, validateTagsSchema } from "./validation"; |
| 5 | |
| 6 | const router = Router(); |
| 7 | |
| 8 | // All routes require authentication |
| 9 | router.use(authenticateToken); |
| 10 | |
| 11 | // Tags CRUD Operations |
| 12 | router.post("/", validateRequest(createTagSchema), tagController.createTag); |
| 13 | router.get("/", tagController.getTags); |
| 14 | router.post("/:tagId", validateRequest(validateTagsSchema), tagController.validateTags); |
| 15 | |
| 16 | export default router; |