fix: default POST request payloads to an empty object (#1141)

* defaulted carts.create payload to an empty object

* fix linting

* requested changes
This commit is contained in:
Kasper Fabricius Kristensen
2022-03-09 17:19:38 +01:00
committed by GitHub
parent 5f5a2af30b
commit 4e7435e4d7
2 changed files with 34 additions and 11 deletions
+4
View File
@@ -187,6 +187,10 @@ class Client {
options: RequestOptions = {},
customHeaders: Record<string, any> = {}
): Promise<any> {
if (method === "POST" && !payload) {
payload = {}
}
const reqOpts = {
method,
withCredentials: true,