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

HttpOptions removes options passed to execute via a overridden methods in a custom DataService #3794

Closed
1 of 2 tasks
cam-m opened this issue Mar 3, 2023 · 0 comments · Fixed by #3795
Closed
1 of 2 tasks
Labels
Accepting PRs bug community watch Someone from the community is working this issue/PR Project: Data

Comments

@cam-m
Copy link
Contributor

cam-m commented Mar 3, 2023

Which @ngrx/* package(s) are the source of the bug?

data

Minimal reproduction of the bug/regression with instructions

When a user creates a Custom Dataservice and passes http options to DataService.execute() they are complete removed by the application of HttpOptions passed via actions. For example:

override getWithQuery(queryParams: QueryParams | string | undefined, options?: HttpOptions): Observable<T[]> {
    const qParams =
      typeof queryParams === 'string'
        ? { fromString: queryParams }
        : { fromObject: queryParams };
    const params = new HttpParams(qParams);

    return this.execute('GET',
      this.entitiesUrl,
      undefined,
      {
        params,
        observe: 'body',
        context: new HttpContext().set(IS_CACHE_ENABLED, true)
      },
      options
    );
  }

observe: 'body' would be removed incorrectly.

Minimal reproduction of the bug/regression with instructions

Expected that all options would passed to execute and merged with any http options

Versions of NgRx, Angular, Node, affected browser(s) and operating system(s)

Ngrx: 15.3

Other information

raised here by @e-oz

I would be willing to submit a PR to fix this issue

  • Yes
  • No
@cam-m cam-m changed the title HttpOptions removes options passed to execute via a overriden methods in a custom DataService HttpOptions removes options passed to execute via a overridden methods in a custom DataService Mar 3, 2023
cam-m pushed a commit to cam-m/ngrx-platform that referenced this issue Mar 3, 2023
cam-m added a commit to cam-m/ngrx-platform that referenced this issue Mar 3, 2023
…dden methods in a custom DataService

Closes ngrx#3794
 - fix broken merge
@timdeschryver timdeschryver added bug Project: Data Accepting PRs community watch Someone from the community is working this issue/PR labels Mar 14, 2023
cam-m pushed a commit to cam-m/ngrx-platform that referenced this issue Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepting PRs bug community watch Someone from the community is working this issue/PR Project: Data
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants