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

Angular: wrong proxy generated if Dictionary used as input for query params #20098

Open
1 task done
antonGritsenko opened this issue Jun 24, 2024 · 0 comments
Open
1 task done
Labels

Comments

@antonGritsenko
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Description

If Dictionary used as query parameters then wrong proxy generated.

Reproduction Steps

Add method to any service:

public virtual async Task<List<AnyDto>> GetSomeAsync([FromQuery] Dictionary<string, string> searchFields)
{
     return new List<AnyDto> = new();
}

Expected behavior

  some = (searchFields: Record<string, string>, config?: Partial<Rest.Config>) =>
    this.restService.request<any, AnyDto[]>({
      method: 'GET',
      url: '/api/app/my-service/some',
      params: searchFields,
    },
    { apiName: this.apiName,...config });

Actual behavior

  some = (searchFields: Record<string, string>, config?: Partial<Rest.Config>) =>
    this.restService.request<any, AnyDto[]>({
      method: 'GET',
      url: '/api/app/my-service/some',
      params: { searchFields },
    },
    { apiName: this.apiName,...config });

See params, this cause wrong URL, for example for input {prop: "value"} you will get object=[object] in the URL instead prop=value.

Regression?

Not sure

Known Workarounds

No

Version

8.1.1

User Interface

Angular

Database Provider

EF Core (Default)

Tiered or separate authentication server

None (Default)

Operation System

Windows (Default)

Other information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant