add tags controller and routes
This commit is contained in:
1 parent
b1871b31a5
commit
451c752170
2 files changed
+126
No files matched your search
@@ -0,0 +1,28 @@
|
||||
import { ITagsController } from "@/controllers/tagController.js";
|
||||
import { Router } from "express";
|
||||
class TagRoutes {
|
||||
private router: Router;
|
||||
private tagController: ITagsController;
|
||||
|
||||
constructor(tagController: ITagsController) {
|
||||
this.router = Router();
|
||||
this.tagController = tagController;
|
||||
this.initializeRoutes();
|
||||
}
|
||||
|
||||
initializeRoutes() {
|
||||
this.router.post("/", this.tagController.createTag);
|
||||
|
||||
this.router.get("/team", this.tagController.getTagsByTeamId);
|
||||
|
||||
this.router.get("/:id", this.tagController.getTagById);
|
||||
this.router.delete("/:id", this.tagController.deleteTag);
|
||||
this.router.patch("/:id", this.tagController.editTag);
|
||||
}
|
||||
|
||||
getRouter() {
|
||||
return this.router;
|
||||
}
|
||||
}
|
||||
|
||||
export default TagRoutes;
|
||||
Reference in new issue
Block a user