From d5e4259bb1343452d51b511d3924948cae37c4ee Mon Sep 17 00:00:00 2001 From: Remi REGNAULT Date: Wed, 29 Nov 2023 15:01:37 +0100 Subject: [PATCH] working on code smells --- API-Project/src/controllers/ingredients.controller.ts | 1 - API-Project/src/controllers/recipes.controller.ts | 1 - API-Project/src/utils/exception.ts | 9 +++++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/API-Project/src/controllers/ingredients.controller.ts b/API-Project/src/controllers/ingredients.controller.ts index 8889d5e..cf0b31c 100644 --- a/API-Project/src/controllers/ingredients.controller.ts +++ b/API-Project/src/controllers/ingredients.controller.ts @@ -1,6 +1,5 @@ import { Router } from "express"; import { Exceptions } from "../utils/exception"; -import { Ingredient } from "../types/ingredients"; import { IngredientsGateway } from "../gateways/ingredients.gateway"; diff --git a/API-Project/src/controllers/recipes.controller.ts b/API-Project/src/controllers/recipes.controller.ts index 6c08fb1..74639a8 100644 --- a/API-Project/src/controllers/recipes.controller.ts +++ b/API-Project/src/controllers/recipes.controller.ts @@ -1,5 +1,4 @@ import { Router } from "express"; -import { Recipe } from "../types/recipes"; import { Exceptions } from "../utils/exception"; import { RecipeGateway } from "../gateways/recipe.gateway"; diff --git a/API-Project/src/utils/exception.ts b/API-Project/src/utils/exception.ts index 8f9b1f3..05627f5 100644 --- a/API-Project/src/utils/exception.ts +++ b/API-Project/src/utils/exception.ts @@ -14,11 +14,12 @@ class Exception implements ApiException { constructor(readonly error: any, readonly status: number) {} } -/** - * Création d'une 404 - */ -export module Exceptions { + +export namespace Exceptions { + /** + * Création d'une 404 + */ export class NotFoundException extends Exception { constructor(error: any) { super(error, 404)