diff --git a/api.js b/api.js index 75c0cd3..5c93f28 100644 --- a/api.js +++ b/api.js @@ -2,21 +2,21 @@ const json = { token: '' -} +}; async function api(url, method, endpoint, message, data, headers) { try { const header = headers !== undefined ? headers : {}; header['Authorization'] = getCookie('token'); - const response = await fetch(url+endpoint, { + const response = await fetch(url + endpoint, { method: method, - body: data === null? undefined : data, - headers : header + body: data === null ? undefined : data, + headers: header }); return await response.json() } catch (e) { - console.error(e.message) - document.getElementById("status").innerText = "Error in "+ message + console.error(e.message); + document.getElementById("status").innerText = "Error in " + message } } diff --git a/arch-front.iml b/arch-front.iml new file mode 100644 index 0000000..8021953 --- /dev/null +++ b/arch-front.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/auth.html b/auth.html index 99eae43..6b7df03 100644 --- a/auth.html +++ b/auth.html @@ -14,24 +14,24 @@