Skip to content

Commit 445886f

Browse files
committed
feat: remove removing response decorator
1 parent 746ee88 commit 445886f

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

lib/plugin/visitors/controller-class.visitor.ts

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -154,20 +154,11 @@ export class ControllerClassVisitor extends AbstractFileVisitor {
154154
const removeExistingApiOperationDecorator =
155155
apiOperationDecoratorsArray.length > 0;
156156

157-
const removeExistingApiResponseDecorator =
158-
apiResponseDecoratorsArray.length > 0;
159-
160-
let existingDecorators = decorators;
161-
if (
162-
removeExistingApiOperationDecorator ||
163-
removeExistingApiResponseDecorator
164-
) {
165-
existingDecorators = decorators.filter(
166-
(item) =>
167-
getDecoratorName(item) !== ApiOperation.name &&
168-
getDecoratorName(item) !== ApiResponse.name
169-
);
170-
}
157+
const existingDecorators = removeExistingApiOperationDecorator
158+
? decorators.filter(
159+
(item) => getDecoratorName(item) !== ApiOperation.name
160+
)
161+
: decorators;
171162

172163
const modifiers = ts.getModifiers(compilerNode) ?? [];
173164
const objectLiteralExpr = this.createDecoratorObjectLiteralExpr(

0 commit comments

Comments
 (0)