Skip to content

Commit 1cf7392

Browse files
fix: Fixed delete operation response handling (#180)
1 parent badbde0 commit 1cf7392

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ in a response, this weakens the Typescript type but does not cause existing usag
2020
This means when upgrading minor versions of the SDK, you may notice type errors. You can safely ignore these or fix by
2121
adding additional type guards.
2222

23+
## 3.2.1 - 2025-08-26
24+
25+
### Fixed
26+
27+
- Fixed a bug where `delete` operations were not returning failures correctly.
28+
29+
---
30+
2331
## 3.2.0 - 2025-08-01
2432

2533
### Added

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@paddle/paddle-node-sdk",
3-
"version": "3.2.0",
3+
"version": "3.2.1",
44
"description": "A Node.js SDK that you can use to integrate Paddle Billing with applications written in server-side JavaScript.",
55
"main": "dist/cjs/index.cjs.node.js",
66
"module": "dist/esm/index.esm.node.js",

src/internal/api/client.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,12 @@ export class Client {
109109

110110
Logger.logResponse('DELETE', logUrl, headers, rawResponse);
111111

112-
return rawResponse as unknown as ErrorResponse | undefined;
112+
if (rawResponse.ok) {
113+
// Return undefined for successful delete operations
114+
return rawResponse as unknown as undefined;
115+
} else {
116+
// Return the error response for unsuccessful delete operations
117+
return rawResponse.json() as Promise<ErrorResponse>;
118+
}
113119
}
114120
}

0 commit comments

Comments
 (0)