Skip to content

Commit 849a44c

Browse files
author
Mateus Garcia
committed
feat: docs
1 parent 422afde commit 849a44c

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

libs/json-api-nestjs/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ import {ExampleService} from '../../service/example/example.service';
8383
@JsonApi(Users, {
8484
allowMethod: excludeMethod(['deleteRelationship']),
8585
requiredSelectField: true,
86+
overrideName: 'user',
8687
})
8788
export class ExtendUserController extends JsonBaseController<Users> {
8889
@InjectService() public service: JsonApiService<Users>;

libs/json-api-nestjs/src/lib/helper/swagger/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export function setSwaggerDecorator(
2424
const entityName =
2525
entity instanceof Function ? entity.name : entity.options.name;
2626

27-
ApiTags(config['overrideName'] || `${camelToKebab(entityName)}`)(
27+
ApiTags(config?.['overrideName'] || `${camelToKebab(entityName)}`)(
2828
controller
2929
);
3030
}

libs/json-api-nestjs/src/lib/mixin/module/module.mixin.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ BaseModuleClass.forRoot = function (options): DynamicModule {
5353

5454
const transformService = transformMixin(entity, connectionName);
5555
const serviceClass = typeormMixin(entity, connectionName, transformService);
56-
Controller(decoratorOptions['overrideName'] || `${camelToKebab(entityName)}`)(
56+
Controller(decoratorOptions?.['overrideName'] || `${camelToKebab(entityName)}`)(
5757
controllerClass
5858
);
5959
UseInterceptors(ErrorInterceptors)(controllerClass);

0 commit comments

Comments
 (0)