Base solution for your next web application
Open Closed

Duplicate parent organization units when selecting multiple children from the UI tree #9853


User avatar
0
BobIngham created

dotnetZero 6.8.0, aspnet Framework 4.6, dotnet core 2.2, angular

This is a question from a very old version. I select three organization units, one parent and two children and the client sends an array of four integers where the parent is repeated for each child. The same goes when I select three children, I have three parent integers, all the same.

My question is, is this normal behaviour? I have updated my organization-unit-tree.component.ts to the latest version (not taking the last update to lodash-es). to bring in some bug fixes, nothing major. I still get the same result.

My decision was to change two instances of the following line in my UserAppService:

//Organization Units await UserManager.SetOrganizationUnitsAsync(user, input.OrganizationUnits.ToArray());

To: //Organization Units await UserManager.SetOrganizationUnitsAsync(user, input.OrganizationUnit.Distinct().ToArray());

This has fixed the problem but I'm wondering if the problem is also there in the latest version?


3 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @bobingham

    Yes, this behaviour is changed in the latest version. When assigning an OU to a user, application doesn't select parent OUs by default.

  • User Avatar
    0
    BobIngham created

    Hi @ismcagdas,

    I think you misunderstand, why do I have two or three parents for two or three children?

  • User Avatar
    0
    musa.demir created

    Hi @bobingham

    Thanks for the warning us about the problem. It does not exists anymore, see: