Skip to content

Commit

Permalink
Fix: correct middleware place 🪠
Browse files Browse the repository at this point in the history
  • Loading branch information
victor-0x29a committed Sep 27, 2024
1 parent 7aba8fc commit b514e69
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/controllers/entity.controller.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Router, Request, Response } from "express";
import ApiCache from 'apicache'
import BaseController from "./base-controller";
import { ValidateSchema } from "./middlewares";
import { ValidateSchema } from "../middlewares";
import { Guard } from "../middlewares";
import { EntityService } from "../services/entity.service";
import { LogService } from "../services/log.service";
Expand Down
1 change: 0 additions & 1 deletion src/controllers/middlewares/index.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/controllers/user.controller.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Request, Response, Router } from "express";
import BaseController from "./base-controller";
import { Guard } from "../middlewares";
import { ValidateSchema } from "./middlewares";
import { ValidateSchema } from "../middlewares";
import { User, UserModel } from "../models/";
import { UserService } from "../services/user.service";
import { idSchema, parsedIdSchema } from "../schemas/global.schema";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Request, Response, NextFunction } from 'express'
import type { Schema } from "yup";
import { validateSchema } from '../../utils/validateSchema';
import { validateSchema } from '../utils/validateSchema';

// TODO: add validate by params and query params
export const ValidateSchema = (
Expand Down
1 change: 1 addition & 0 deletions src/middlewares/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from './guard'
export * from './handlerException'
export * from './SchemaValidation'

0 comments on commit b514e69

Please sign in to comment.