|
|
@ -4,7 +4,7 @@ function sendRequest(path, method, body, sendResp) { |
|
|
|
headers: method !== "GET" ? { |
|
|
|
"Content-Type": "application/json", |
|
|
|
} : undefined, |
|
|
|
body: body ? JSON.stringify(body) : undefined, |
|
|
|
body: body !== null ? JSON.stringify(body) : undefined, |
|
|
|
}).then(r => r.json()) |
|
|
|
.then(data => sendResp({success: true, data})) |
|
|
|
.catch(e => sendResp({success: false, message: e.message})); |
|
|
|