diff --git a/package-lock.json b/package-lock.json
index cc86a7d..a0db900 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -18,6 +18,7 @@
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
+ "axios": "^1.3.5",
"bootstrap": "^5.2.3",
"react": "^18.2.0",
"react-bootstrap": "^2.7.2",
@@ -5717,6 +5718,29 @@
"node": ">=4"
}
},
+ "node_modules/axios": {
+ "version": "1.3.5",
+ "resolved": "https://registry.npmjs.org/axios/-/axios-1.3.5.tgz",
+ "integrity": "sha512-glL/PvG/E+xCWwV8S6nCHcrfg1exGx7vxyUIivIA1iL7BIh6bePylCfVHwp6k13ao7SATxB6imau2kqY+I67kw==",
+ "dependencies": {
+ "follow-redirects": "^1.15.0",
+ "form-data": "^4.0.0",
+ "proxy-from-env": "^1.1.0"
+ }
+ },
+ "node_modules/axios/node_modules/form-data": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
+ "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
+ "dependencies": {
+ "asynckit": "^0.4.0",
+ "combined-stream": "^1.0.8",
+ "mime-types": "^2.1.12"
+ },
+ "engines": {
+ "node": ">= 6"
+ }
+ },
"node_modules/axobject-query": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.1.1.tgz",
@@ -15119,6 +15143,11 @@
"node": ">= 0.10"
}
},
+ "node_modules/proxy-from-env": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
+ "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
+ },
"node_modules/psl": {
"version": "1.9.0",
"resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz",
@@ -17263,19 +17292,6 @@
"is-typedarray": "^1.0.0"
}
},
- "node_modules/typescript": {
- "version": "4.9.5",
- "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz",
- "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==",
- "peer": true,
- "bin": {
- "tsc": "bin/tsc",
- "tsserver": "bin/tsserver"
- },
- "engines": {
- "node": ">=4.2.0"
- }
- },
"node_modules/unbox-primitive": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz",
diff --git a/package.json b/package.json
index cec5eac..28de1b6 100644
--- a/package.json
+++ b/package.json
@@ -13,6 +13,7 @@
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
+ "axios": "^1.3.5",
"bootstrap": "^5.2.3",
"react": "^18.2.0",
"react-bootstrap": "^2.7.2",
diff --git a/src/components/MostRecentFunctioningViewBudget.txt b/src/components/MostRecentFunctioningViewBudget.txt
new file mode 100644
index 0000000..a200b91
--- /dev/null
+++ b/src/components/MostRecentFunctioningViewBudget.txt
@@ -0,0 +1,58 @@
+import React, {useState, useEffect} from 'react';
+import './css/ViewBudget.css'
+import logo from './widget_logos/current_balance_logo.png';
+
+function FetchAPI() {
+ const [data, setData] = useState('')
+
+
+ useEffect(() => {
+ const apiGet = () => {
+ fetch('http://127.0.0.1:3030/w/balance', {
+ METHOD: 'GET',
+ headers: {
+ 'x-session-key': "b36efa01-7824-4f61-a274-63131b58d8fe"
+ }
+ }
+ )
+ .then((response) => response.json())
+ .then(data => setData(data.balance));
+ };
+ apiGet();
+
+ }, [])
+
+ function saveData() {
+ let item = {data}
+ console.warn(data.balance);
+ // fetch('http://127.0.0.1:3030/w/balance', {
+ // METHOD: 'POST',
+ // headers: {
+ // 'x-session-key': "b36efa01-7824-4f61-a274-63131b58d8fe"
+ // },
+ // body:JSON.stringify(data)
+ // }
+ // )
+ // .then((response) => response.json())
+ // .then(data => setData(data.balance));
+ }
+ return (
+ <>
+ {/*
+ Current Balance: ${data} */}
+ {/* */}
+
{data.body}
)}