aboutsummaryrefslogtreecommitdiff
path: root/api/static
diff options
context:
space:
mode:
authorParker <contact@pkrm.dev>2024-11-10 23:17:10 -0600
committerParker <contact@pkrm.dev>2024-11-10 23:17:10 -0600
commit05666369a2e9bb23f9471b11009963eccc838bf6 (patch)
tree11a63a514d4655932ae6f8d3fcb2589d31a53150 /api/static
parentcd237804149bb098868048ccc001d3a6db986565 (diff)
Some clean-up
Diffstat (limited to 'api/static')
-rw-r--r--api/static/js/api.js26
1 files changed, 0 insertions, 26 deletions
diff --git a/api/static/js/api.js b/api/static/js/api.js
deleted file mode 100644
index 243edf7..0000000
--- a/api/static/js/api.js
+++ /dev/null
@@ -1,26 +0,0 @@
-// Description: This file contains functions to access the API with JWT authentication.
-
-/**
- * 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(`/api${endpoint}`, {
- method: method,
- body: body,
- });
-
- if (response.ok) {
- let data = await response.json();
- data = await data;
- return data;
-
- }
-
- return false;
-} \ No newline at end of file