Skip to content

Commit

Permalink
fix: code style
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateus Garcia committed Apr 16, 2023
1 parent bea7122 commit 2c04ca6
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions libs/json-api-nestjs/src/lib/mixin/module/module.mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {
getProviderName,
camelToKebab,
} from '../../helper';
import { JsonBaseController } from '../controller';
import { typeormMixin, transformMixin } from '../';
import {
JSON_API_DECORATOR_OPTIONS,
Expand Down Expand Up @@ -52,13 +51,11 @@ BaseModuleClass.forRoot = function (options): DynamicModule {
controllerClass
);

const resourceName = decoratorOptions?.overrideName
? decoratorOptions.overrideName
: `${camelToKebab(entityName)}`;

const transformService = transformMixin(entity, connectionName);
const serviceClass = typeormMixin(entity, connectionName, transformService);
Controller(resourceName)(controllerClass);
Controller(decoratorOptions['overrideName'] || `${camelToKebab(entityName)}`)(
controllerClass
);
UseInterceptors(ErrorInterceptors)(controllerClass);
Inject(serviceClass)(controllerClass.prototype, 'serviceMixin');
const properties = Reflect.getMetadata(
Expand Down

0 comments on commit 2c04ca6

Please sign in to comment.