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

bug/many2one_relationship_dropdown #1194

Merged
merged 26 commits into from
Oct 21, 2022

Conversation

tristanblc
Copy link
Contributor

@tristanblc tristanblc commented Oct 13, 2022

Hi,
I created new controller ( PublicUsersControllers) who return only activated users.
This controller have route "/api/users".

@CLAassistant
Copy link

CLAassistant commented Oct 13, 2022

CLA assistant check
All committers have signed the CLA.

{
<%_ if (databaseType === 'mongodb') { _%>
var page = await Task.FromResult((_userManager.Users as IMongoQueryable<User>)
.Include(it => it.UserRoles)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

user roles and role is not necessary

.UsePageable(request.Page));
<%_ } else { _%>
var page = await _userManager.Users
.Include(it => it.UserRoles)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

user roles and role is not necessary

{
<%_ if (databaseType === 'mongodb') { _%>
IPage<User> users = await (_userManager.Users as IMongoQueryable<User>)
.Include(it => it.UserRoles)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

user roles and role is not necessary

return users;
<%_ } else { _%>
return await _userManager.Users
.Include(it => it.UserRoles)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

user roles and role is not necessary

using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Microsoft.EntityFrameworkCore;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are multiple unused using



[HttpGet]
public async Task<ActionResult<IEnumerable<User>>> GetAllPublicUsers(IPageable pageable)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return an USERDTO here

private readonly IMediator _mediator;
<%_ } else { _%>
private readonly IMapper _mapper;
private readonly IMailService _mailService;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove unused fields (mailservice and user manager)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I can

@sonarcloud
Copy link

sonarcloud bot commented Oct 20, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Member

@nicolas63 nicolas63 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks for your contribution !

@nicolas63 nicolas63 merged commit 4a60d00 into jhipster:main Oct 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants