routes -> ts

This commit is contained in:
Alex Holliday committed 2026-01-21 10:36:03 -08:00
1 parent 35488fed3e
commit 81c7c992e2
13 files changed
+74 -42

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
import { RequestHandler, Router } from "express";
import { isAllowed } from "../middleware/isAllowed.js";
class InviteRoutes {
private router: Router;
private inviteController: any;
constructor(inviteController: any, verifyJWT: RequestHandler) {
this.router = Router();
this.inviteController = inviteController;
this.initRoutes(verifyJWT);
}
initRoutes(verifyJWT: RequestHandler) {
this.router.post("/send", verifyJWT, isAllowed(["admin", "superadmin"]), this.inviteController.sendInviteEmail);
this.router.post("/verify", this.inviteController.verifyInviteToken);
this.router.post("/", verifyJWT, isAllowed(["admin", "superadmin"]), this.inviteController.getInviteToken);
}
getRouter() {
return this.router;
}
}
export default InviteRoutes;