From 445886f1890a487abaf21ded65e2ed46d4626d55 Mon Sep 17 00:00:00 2001 From: Tianning Li Date: Mon, 12 Feb 2024 16:21:47 -0800 Subject: [PATCH] feat: remove removing response decorator --- .../visitors/controller-class.visitor.ts | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/lib/plugin/visitors/controller-class.visitor.ts b/lib/plugin/visitors/controller-class.visitor.ts index 75b9742d2..4793bfd38 100644 --- a/lib/plugin/visitors/controller-class.visitor.ts +++ b/lib/plugin/visitors/controller-class.visitor.ts @@ -154,20 +154,11 @@ export class ControllerClassVisitor extends AbstractFileVisitor { const removeExistingApiOperationDecorator = apiOperationDecoratorsArray.length > 0; - const removeExistingApiResponseDecorator = - apiResponseDecoratorsArray.length > 0; - - let existingDecorators = decorators; - if ( - removeExistingApiOperationDecorator || - removeExistingApiResponseDecorator - ) { - existingDecorators = decorators.filter( - (item) => - getDecoratorName(item) !== ApiOperation.name && - getDecoratorName(item) !== ApiResponse.name - ); - } + const existingDecorators = removeExistingApiOperationDecorator + ? decorators.filter( + (item) => getDecoratorName(item) !== ApiOperation.name + ) + : decorators; const modifiers = ts.getModifiers(compilerNode) ?? []; const objectLiteralExpr = this.createDecoratorObjectLiteralExpr(