Kaynağa Gözat

Refactor: Consolidate input types into a single index file and update imports in auth routes

emrecevik106 1 ay önce
ebeveyn
işleme
a10b05e3ed

+ 1 - 1
src/actions/auth/index.ts

@@ -18,4 +18,4 @@ export {
 } from "./finishMailVerify";
 export {
     default as startMailVerify 
-} from "./startMailVerify";
+} from "./startMailVerify";

+ 15 - 0
src/actions/auth/types/index.ts

@@ -0,0 +1,15 @@
+export {
+    RegisterInput 
+} from "../../auth/register/types";
+export {
+    LoginInput 
+} from "../../auth/login/types";
+export {
+    FinishMailVerifyInput 
+} from "../../auth/finishMailVerify/types";
+export {
+    RefreshTokenInput 
+} from "../../auth/refreshToken/types";
+export {
+    StartMailVerifyInput 
+} from "../../auth/startMailVerify/types";

+ 6 - 11
src/routes/authRoutes.ts

@@ -18,17 +18,11 @@ import {
     validateBody 
 } from "../middlewares/validateBody";
 import {
-    RegisterInput 
-} from "../actions/auth/register/types";
-import {
-    LoginInput 
-} from "../actions/auth/login/types";
-import {
-    FinishMailVerifyInput 
-} from "../actions/auth/finishMailVerify/types";
-import {
-    RefreshTokenInput
-} from "../actions/auth/refreshToken/types";
+    FinishMailVerifyInput,
+    RefreshTokenInput,
+    RegisterInput,
+    LoginInput
+} from "../actions/auth/types/index";
 
 const router = Router();
 
@@ -36,6 +30,7 @@ router.post("/finish-mail-verify", validateBody(FinishMailVerifyInput), finishMa
 router.post("/refresh-token", validateBody(RefreshTokenInput), refreshToken);
 router.post("/register", validateBody(RegisterInput), register);
 router.post("/login", validateBody(LoginInput), login);
+router.post("/start-mail-verify", startMailVerify);
 router.post("/logout", authMiddleware, logout);
 router.get("/me", authMiddleware, me);