Skip to content

Commit

Permalink
fix: preserve key name in Date transformation
Browse files Browse the repository at this point in the history
  • Loading branch information
mrlubos committed Aug 10, 2024
1 parent a2d26ef commit a8c84c0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .changeset/proud-wombats-occur.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@example/openapi-ts-fetch': patch
'@hey-api/client-fetch': patch
---

fix: preserve key name in Date transformation
2 changes: 1 addition & 1 deletion packages/client-fetch/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ const serializeObjectParam = ({
value: Record<string, unknown> | Date;
}) => {
if (value instanceof Date) {
return value.toISOString();
return `${name}=${value.toISOString()}`;
}

if (style !== 'deepObject' && !explode) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ const serializeObjectParam = ({
value: Record<string, unknown> | Date;
}) => {
if (value instanceof Date) {
return value.toISOString();
return `${name}=${value.toISOString()}`;
}
if (style !== 'deepObject' && !explode) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ const serializeObjectParam = ({
value: Record<string, unknown> | Date;
}) => {
if (value instanceof Date) {
return value.toISOString();
return `${name}=${value.toISOString()}`;
}
if (style !== 'deepObject' && !explode) {
Expand Down

0 comments on commit a8c84c0

Please sign in to comment.