diff options
author | Parker <contact@pkrm.dev> | 2024-11-11 20:29:56 -0600 |
---|---|---|
committer | Parker <contact@pkrm.dev> | 2024-11-11 20:29:56 -0600 |
commit | 918a04076fa582200cc5b5b542f6d7b47c0fa5e0 (patch) | |
tree | 67ab9243785b549225f273f8961694c76157060a /app/src/helpers/api.js | |
parent | c0b5500f007b0ec7a116a5dd20083e66cba7409e (diff) |
Fix formatting - mainly spacing
Diffstat (limited to 'app/src/helpers/api.js')
-rw-r--r-- | app/src/helpers/api.js | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/app/src/helpers/api.js b/app/src/helpers/api.js deleted file mode 100644 index 0381f18..0000000 --- a/app/src/helpers/api.js +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Accept an API endpoint, method, and body to send to the API. - * - If successful, return the response - * - If not, return false - * @param {*} endpoint API endpoint - * @param {*} method String (GET, POST, PUT, DELETE) - * @param {*} body Data to send to the API - * @returns response.json or false - */ -async function accessAPI(endpoint, method, body) { - let response = await fetch(`http://127.0.0.1:5252/api${endpoint}`, { - method: method, - credentials: 'include', - body: body, - }); - - if (response.ok) { - let data = await response.json(); - data = await data; - return data; - - } - - return false; -} - -export { accessAPI };
\ No newline at end of file |