all the latest socket work

This commit is contained in:
ari committed 2022-06-01 21:17:16 -04:00
1 parent a530e5e6e0
commit bc773154c6
18 files changed
+117 -61

No files matched your search

+6 -3
View File
@@ -10,13 +10,16 @@ export const makeRemoteAPI = (baseURL: string): API => ({
data = {}
}) {
try {
const reply = await fetch(baseURL + path, {
const payload: RequestInit = {
method,
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(data),
});
};
if (method !== 'GET') {
payload["body"] = JSON.stringify(data);
}
const reply = await fetch(baseURL + path, payload);
let response: APIResponse<any>;
if (reply.status === 200) {
response = {