Open Closed

[Question] - Expose GET organization units lookup service #6904


User avatar
0
trannguyenphucanh created
  • ABP Framework version: v8.0.4
  • UI Type: Angular
  • Database System: EF Core (MySQL)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

Hi Support Team,

I want to customize method logic of the below API endpoint api/identity/users/lookup/organization-units, but I am unable to find the method anywhere in your source code:

There is IdentityUserLookupController.cs, but it doesn't declare the method:

Where do I find it for service exposing?


6 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    The source code files are:

    identity-pro/src/Volo.Abp.Identity.Pro.HttpApi/Volo/Abp/Identity/IdentityUserLookupController.cs
    ⬇️⬇️⬇️
    identity-pro/src/Volo.Abp.Identity.Pro.Application/Volo/Abp/Identity/IdentityUserLookupAppService.cs
    ⬇️⬇️⬇️
    identity-pro/src/Volo.Abp.Identity.Pro.Application/Volo/Abp/Identity/Integration/IdentityUserIntegrationService.cs
    
  • User Avatar
    0
    trannguyenphucanh created

    Hi maliming,

    Thanks. But it doesn't seem to include the API endpoint calling the method that I want to expose:

    Could you be more specific?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you check this?

    identity-pro/src/Volo.Abp.Identity.Pro.HttpApi/Volo/Abp/Identity/IdentityUserController.cs

  • User Avatar
    0
    trannguyenphucanh created

    The return dto OrganizationUnitLookupDto only contains Id and DisplayName, what I am looking for is the ParentId field as well. Before upgrade, I handled the dropdown so that I could add indents as below:

    Here was the code, called another sorted list and handled HTML elements:

      ngAfterViewInit(): void {
        var organizationUnit = document.querySelector("#organizationUnitIdFilter");
        var option = '';
        this.orgService.getOrganizationUnitsList().subscribe(
          data => {
            this.countryOptions = data;
            var index = 1;
            this.countryOptions.forEach(element => {
              let spaceChild = '';
              if (element.parentId) {
                spaceChild = '<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>';
              }
              option += '<option value="' + index++ + ': ' + element.id + '"' + ' [hidden]="' + element.isDisabled + '">' + spaceChild + element.displayName + '</option>';
            })
            organizationUnit.innerHTML = '<option></option>' + option;
          },
          error => {
            console.log(error);
          }
        );
      }
    

    After upgraded, the dropdown looks the same, but Id input seems from the original list without ngAfterViewInit:

    For example, if I select China, then Id of 946 Singapore is passed.

    Do you have any idea?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    This seems like a UI issue, I don't have any idea, you can continue debugging to see why the id is incorrect.

    Thanks.

  • User Avatar
    0
    trannguyenphucanh created

    Nevermind, I found and modified response from the service call IdentityUserService, thus resolved the problem:

Made with ❤️ on ABP v9.1.0-preview. Updated on December 13, 2024, 06:09