Skip to content

Commit

Permalink
feat: remove removing response decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
lit26 committed Feb 13, 2024
1 parent 746ee88 commit 445886f
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions lib/plugin/visitors/controller-class.visitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 445886f

Please sign in to comment.