From 55e19609e8836e8b1e40d4dee10a06d254a5fcef Mon Sep 17 00:00:00 2001 From: oitsjustjose Date: Fri, 15 Apr 2022 08:35:34 -0500 Subject: [PATCH] Further index.ts ref --- backend/src/app.ts | 2 +- backend/src/app/controllers/{routes.ts => index.ts} | 0 backend/src/app/controllers/product/index.ts | 2 +- backend/src/app/controllers/review/index.ts | 2 +- .../src/app/controllers/user/{crud => auth}/forgot.ts | 0 backend/src/app/controllers/user/auth/login.ts | 4 ++-- backend/src/app/controllers/user/index.ts | 10 +++++----- 7 files changed, 10 insertions(+), 10 deletions(-) rename backend/src/app/controllers/{routes.ts => index.ts} (100%) rename backend/src/app/controllers/user/{crud => auth}/forgot.ts (100%) diff --git a/backend/src/app.ts b/backend/src/app.ts index 2d3d90b..e99fb93 100644 --- a/backend/src/app.ts +++ b/backend/src/app.ts @@ -1,7 +1,7 @@ import { json, urlencoded } from "body-parser"; import cors from "cors"; import express from "express"; -import Routes from "./app/controllers/routes"; +import Routes from "./app/controllers"; import AccessLog from "./app/middleware/AccessLog"; import UserInjection from "./app/middleware/UserInjection"; import { UserModel } from "./app/models/User"; diff --git a/backend/src/app/controllers/routes.ts b/backend/src/app/controllers/index.ts similarity index 100% rename from backend/src/app/controllers/routes.ts rename to backend/src/app/controllers/index.ts diff --git a/backend/src/app/controllers/product/index.ts b/backend/src/app/controllers/product/index.ts index b4c6bb8..8b59eb9 100644 --- a/backend/src/app/controllers/product/index.ts +++ b/backend/src/app/controllers/product/index.ts @@ -1,4 +1,4 @@ -import { RouteCollection } from "../routes"; +import { RouteCollection } from ".."; import create from "./crud/create"; import del from "./crud/delete"; import get from "./crud/get"; diff --git a/backend/src/app/controllers/review/index.ts b/backend/src/app/controllers/review/index.ts index e9134a7..4c5855e 100644 --- a/backend/src/app/controllers/review/index.ts +++ b/backend/src/app/controllers/review/index.ts @@ -1,4 +1,4 @@ -import { RouteCollection } from "../routes"; +import { RouteCollection } from ".."; import create from "./crud/create"; import update from "./crud/update"; import del from "./crud/delete"; diff --git a/backend/src/app/controllers/user/crud/forgot.ts b/backend/src/app/controllers/user/auth/forgot.ts similarity index 100% rename from backend/src/app/controllers/user/crud/forgot.ts rename to backend/src/app/controllers/user/auth/forgot.ts diff --git a/backend/src/app/controllers/user/auth/login.ts b/backend/src/app/controllers/user/auth/login.ts index e710d39..2fe8589 100644 --- a/backend/src/app/controllers/user/auth/login.ts +++ b/backend/src/app/controllers/user/auth/login.ts @@ -6,8 +6,8 @@ import { Request, Response } from "express"; import * as jwt from "jsonwebtoken"; import moment from "moment"; -import Users, { UserModel } from "../../models/User"; -import { LOGGER } from "../../util/Logger"; +import Users, { UserModel } from "../../../models/User"; +import { LOGGER } from "../../../util/Logger"; export default async (req: Request, res: Response) => { try { diff --git a/backend/src/app/controllers/user/index.ts b/backend/src/app/controllers/user/index.ts index 54bdc53..69e0890 100644 --- a/backend/src/app/controllers/user/index.ts +++ b/backend/src/app/controllers/user/index.ts @@ -1,7 +1,7 @@ -import { RouteCollection } from "../routes"; +import { RouteCollection } from ".."; import create from "./crud/create"; import del from "./crud/delete"; -import forgot from "./crud/forgot"; +import forgot from "./auth/forgot"; import login from "./auth/login"; import validate from "./auth/validate"; @@ -18,17 +18,17 @@ const routes: RouteCollection[] = [ }, { httpMethod: "POST", - path: "/api/v1/user/login", + path: "/api/v1/user/auth/login", handler: login, }, { httpMethod: "GET", - path: "/api/v1/user/forgot", + path: "/api/v1/user/auth/forgot", handler: forgot, }, { httpMethod: "GET", - path: "/api/v1/user/validateEmail", + path: "/api/v1/user/auth/email/validate", handler: validate, }, ];