Browse Source
Fix the API breakage on posting a CfdOrderRequest
Recent PR #175 introduced a breaking change and the UI did not get updated.
upload-correct-windows-binary
Mariusz Klochowicz
3 years ago
No known key found for this signature in database
GPG Key ID: 470C865699C8D4D
1 changed files with
1 additions and
1 deletions
-
frontend/src/TakerApp.tsx
|
@ -41,7 +41,7 @@ interface MarginResponse { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
async function postCfdOrderRequest(payload: CfdOrderRequestPayload) { |
|
|
async function postCfdOrderRequest(payload: CfdOrderRequestPayload) { |
|
|
let res = await fetch(`/api/cfd`, { method: "POST", body: JSON.stringify(payload) }); |
|
|
let res = await fetch(`/api/cfd/order`, { method: "POST", body: JSON.stringify(payload) }); |
|
|
|
|
|
|
|
|
if (!res.status.toString().startsWith("2")) { |
|
|
if (!res.status.toString().startsWith("2")) { |
|
|
throw new Error("failed to create new CFD order request: " + res.status + ", " + res.statusText); |
|
|
throw new Error("failed to create new CFD order request: " + res.status + ", " + res.statusText); |
|
|