Skip to content
This repository has been archived by the owner on Mar 21, 2021. It is now read-only.

[BUG] Wrong router params when the relationship is between the same entity #438

Open
Datlyfe opened this issue Aug 1, 2019 · 2 comments
Labels
bug Something isn't working

Comments

@Datlyfe
Copy link

Datlyfe commented Aug 1, 2019

I think there is a bug when an entity has a relationship to the same entity .
the id param that is passed to the router link params: {<%= relationshipFieldName %>Id : ...
should be replaced with params: {<%= otherEntityStateName %>Id : .... located in the entity.vue.ejs file otherwise the router will throw missing param for named route "${entity}View" warning.
you can test this by importing this jdl file https://github.com/jhipster/jdl-samples/blob/master/simple-online-shop.jh#L42
you will notice that the route param for the parent field is set to parentId : category.parent.id insted of categoryId : category.parent.id
this issue does not exist when importing this jdl file in an Angular/React jhipster generated application.

@Datlyfe Datlyfe changed the title fix router params when the relationship is between the same entity [BUG] Wrong router params when the relationship is between the same entity Aug 1, 2019
@atomfrede atomfrede added the bug Something isn't working label Aug 7, 2019
@atomfrede
Copy link
Member

Thanks @Datlyfe for reporting this. As it seems you already have investigated what the problem is and how to resolve it, would you mind creating a PR? If you have any questions on how to do it don't hesitate to ask or comment here, we are happy to help.

@Datlyfe
Copy link
Author

Datlyfe commented Aug 8, 2019

@atomfrede Sure, i'll submit a PR as soon as i can.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants