Closed kun391 closed 1 year ago
You can not change name of route. I don't have plane for add this feature
@klerick Would you re-consider accepting this feature request if I try to come up with a solution for it and then open a PR?
I'm thinking about an option on our JsonApi
decorator where you can overwrite what goes into the Controller
decorator.
IE:
@JsonApi(User, {
requiredSelectField: false,
overrideEndpoint: 'users'
})
export class UserController extends JsonBaseController<User> {}
So we keep everything as is today but we would just have the option to change the endpoint path.
@Mites-G I have viewed source code, so now I believe will need to do minimal changes for this feature.
I think, it will be like that:
${camelToKebab(entityName)}
)(controllerClass); need to chang:
Controller(decoratorOptions[' overrideEndpoint'] || `${camelToKebab(entityName)}`)(controllerClass);
Awesome, @klerick. I was looking further into that and we reached the same conclusion.
Here's the pull request: https://github.com/klerick/nestjs-json-api/pull/43
Any more suggestions appreciated.
today I having weekend)but tomorrow, I will approve your pr and create new version.
Enjoy your weekend!
:tada: This issue is included in version json-api-nestjs@4.2.11 :tada:
The release is available on GitHub release
:tada: This issue is included in version json-api-nestjs-sdk@5.0.0 :tada:
The release is available on GitHub release
Hi,
I have an entity class name
User
, now, the resource name generated is/user/
So if I want to generate to/users
, I must rename the class name toUsers
Have any options to override the resource to
users
with the entity class nameUser
on your package @klerick?Thanks