initial commit
This commit is contained in:
1 parent
7cb985116e
commit
75acf7b38f
955 files changed
+37333
-87054
No files matched your search
@@ -0,0 +1,33 @@
|
||||
import { Router } from "express";
|
||||
import { RecoveryController } from "@/controllers/index.js";
|
||||
import { validateBody } from "@/middleware/validation.js";
|
||||
import { recoverySchema, resetPasswordSchema } from "@/validation/index.js";
|
||||
class RecoveryRoutes {
|
||||
private router;
|
||||
private controller;
|
||||
constructor(recoveryController: RecoveryController) {
|
||||
this.router = Router();
|
||||
this.controller = recoveryController;
|
||||
this.initRoutes();
|
||||
}
|
||||
|
||||
initRoutes = () => {
|
||||
this.router.post(
|
||||
"/",
|
||||
validateBody(recoverySchema),
|
||||
this.controller.requestRecovery
|
||||
);
|
||||
|
||||
this.router.post(
|
||||
"/reset",
|
||||
validateBody(resetPasswordSchema),
|
||||
this.controller.resetPassword
|
||||
);
|
||||
};
|
||||
|
||||
getRouter() {
|
||||
return this.router;
|
||||
}
|
||||
}
|
||||
|
||||
export default RecoveryRoutes;
|
||||
Reference in new issue
Block a user