You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The problem is, that the frontend (and maybe some other places too) respect the pkType setting whilst for the NestJS Backend, this configuration option is ignored. The type is hardcoded in base.entity.ts (among others). As the default value for pkType seems to be number for databases like MySQL (see https://github.com/jhipster/generator-jhipster/blob/f12952fc9e0bcfa77052d315ee7968b49b1f3442/generators/generator-base-private.js#L1240) , the problem is effective without setting an explicit value for the configuration option.
The consequence of this problem is that the frontend expects the ids to be numbers while they are actually strings. This can have implications on the generated app and is likely to cause typing problems when comparing, filtering, sorting, etc.
To Reproduce
Steps to reproduce the behavior:
Generate a new app via nhipster
Select the default option for every question
Compare server/src/domain/base/base.entity.ts (server) and src/main/webapp/app/entities/user/user.model.ts
Expected behavior
Type of the id property matches in both files
Actual behavior
Type of id property in base.entity.ts: string
Type of id property in user.model.ts: number
Desktop (please complete the following information):
Thanks for the contributing!
So, I defined the pkType as string and not customizable for nestjs simple use cases, it does not use, for example, the filter features. Besides this generator has been created from a old jhipster 6.x version.
Describe the bug
The problem is, that the frontend (and maybe some other places too) respect the
pkType
setting whilst for the NestJS Backend, this configuration option is ignored. The type is hardcoded in base.entity.ts (among others). As the default value forpkType
seems to benumber
for databases like MySQL (see https://github.com/jhipster/generator-jhipster/blob/f12952fc9e0bcfa77052d315ee7968b49b1f3442/generators/generator-base-private.js#L1240) , the problem is effective without setting an explicit value for the configuration option.The consequence of this problem is that the frontend expects the ids to be numbers while they are actually strings. This can have implications on the generated app and is likely to cause typing problems when comparing, filtering, sorting, etc.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Type of the id property matches in both files
Actual behavior
Type of id property in base.entity.ts: string
Type of id property in user.model.ts: number
Desktop (please complete the following information):
NHipster configuration
.yo-rc.json
Additional context
I discovered the problem while working on #214
I have prepared a branch to fix this which I will link as a PR soon.
The text was updated successfully, but these errors were encountered: