Browse Source

Let rocket know what we are sending is JSON

fix-bad-api-calls
Thomas Eizinger 3 years ago
parent
commit
7dd527ac72
No known key found for this signature in database GPG Key ID: 651AC83A6C6C8B96
  1. 9
      frontend/src/Maker.tsx

9
frontend/src/Maker.tsx

@ -31,7 +31,14 @@ interface 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")) {
console.log("Status: " + res.status + ", " + res.statusText);

Loading…
Cancel
Save