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?

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

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
    
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • 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?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • 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

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • 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?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • 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.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    trannguyenphucanh created

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

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 28, 2026, 11:44
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.