Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Many-To-One relationship to User does not load users dropdown list on client #741

Open
1 task done
ivanmonteiro opened this issue May 13, 2021 · 4 comments
Open
1 task done
Labels
bug 🐞 Something isn't working good first issue 👍 Good for newcomers up-for-grabs

Comments

@ivanmonteiro
Copy link
Contributor

Overview of the issue

The client (angular) is not loading users dropdown list when a relationship exists with User entity.
On the client-side the User dorpdown-list does not load any users.
Http GET request to /api/users returns not found (since there is no api endpoint on the backend side).
It seems that we do have the route /api/admin/users at

public async Task<ActionResult<IEnumerable<User>>> GetAllUsers(IPageable pageable)
but the client requests /api/users which does not exist.

Motivation for or Use Case
Reproduce the error

Create an entity and add a relationship to User:

entity Employee {
    name String required
}

relationship ManyToOne {
    Employee{user(login)} to User
}
Related issues
Suggest a Fix
JHipster Version(s)

Master

JHipster configuration
Entity configuration(s) entityName.json files generated in the .jhipster directory
Browsers and Operating System
  • Checking this box is mandatory (this is just to show you read everything)
@nicolas63
Copy link
Member

It's a bug on dotnet generator or the java genrator has the same behavior ?

@ivanmonteiro
Copy link
Contributor Author

ivanmonteiro commented May 20, 2021

It's a bug on dotnet generator or the java genrator has the same behavior ?

I think It's a bug on dotnet generator. I remeber that on java version and on the v2 of dotnet generator User relationship dropdownlist loads fine.
Just on v3 of dotnet generator it stopped working due to the api route change described above.

@nicolas63 nicolas63 added the bug 🐞 Something isn't working label May 25, 2021
@nicolas63
Copy link
Member

Oh ok, can you take this issue and modify the users route ?

@nicolas63
Copy link
Member

in the java version they are a public user endpoint like here (https://github.com/jhipster/jhipster-sample-app/blob/db781b4d0947ff9dc9d1eb74939305fbfd0b26d0/src/main/java/io/github/jhipster/sample/web/rest/PublicUserResource.java). We can create a controller with this route who return like the java version only activated users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working good first issue 👍 Good for newcomers up-for-grabs
Projects
None yet
Development

No branches or pull requests

2 participants