Conversation
- use ng new to re-create from standard template - switch to plain css instead of scss, we're not interested in styles for these tests - upgrade to typescript v5 everywhere
HttpParams is immutable, and so previously the query parameter handling didn't work at all. Now it has an expanded type to support the stripe client, and also correctly returns the final object. However, it does not yet support array or objects passed as a query parameter and will throw an exception if this happens.
mnahkies
commented
May 4, 2023
| if (value !== undefined && value !== null) { | ||
| result.set(name, String(value)) | ||
| private _queryParams(queryParams: QueryParams): HttpParams { | ||
| return Object.entries(queryParams).reduce((result, [name, value]) => { |
Owner
Author
There was a problem hiding this comment.
Turns out that the HttpParams object is immutable, and so this was previously totally broken.
ref: https://angular.io/api/common/http/HttpParams#description
This class is immutable; all mutation operations return a new instance.
mnahkies
commented
May 4, 2023
| } | ||
| }) | ||
| return result | ||
| throw new Error( |
Owner
Author
There was a problem hiding this comment.
Getting the behavior right for array and object types is tricky. Throw an exception for now to allow the QueryParams type to still accept them to make the stripe code happy and come back to it later
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
use ng new to re-create from standard template
switch to plain css instead of scss, we're not interested in styles for these tests
upgrade to typescript v5 everywhere