Browse Source
Let rocket know what we are sending is JSON
fix-bad-api-calls
Thomas Eizinger
3 years ago
No known key found for this signature in database
GPG Key ID: 651AC83A6C6C8B96
1 changed files with
8 additions and
1 deletions
-
frontend/src/Maker.tsx
|
@ -31,7 +31,14 @@ interface CfdSellOrderPayload { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
async function postCfdSellOrderRequest(payload: CfdSellOrderPayload) { |
|
|
async function postCfdSellOrderRequest(payload: CfdSellOrderPayload) { |
|
|
let res = await fetch(`/api/order/sell`, { method: "POST", body: JSON.stringify(payload), credentials: "include" }); |
|
|
let res = await fetch(`/api/order/sell`, { |
|
|
|
|
|
method: "POST", |
|
|
|
|
|
body: JSON.stringify(payload), |
|
|
|
|
|
headers: { |
|
|
|
|
|
"Content-Type": "application/json", |
|
|
|
|
|
}, |
|
|
|
|
|
credentials: "include", |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
if (!res.status.toString().startsWith("2")) { |
|
|
if (!res.status.toString().startsWith("2")) { |
|
|
console.log("Status: " + res.status + ", " + res.statusText); |
|
|
console.log("Status: " + res.status + ", " + res.statusText); |
|
|