diff options
| author | clarkohw <66530369+clarkohw@users.noreply.github.com> | 2021-04-19 16:17:31 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-19 16:17:31 -0400 |
| commit | 3780077f257b973426577d6168936a3ce0a904e3 (patch) | |
| tree | e91feb27c711f65814753b0a41ad49da76cf62ea /frontend/src/SECAPIData.js | |
| parent | f00c1c6e89db16b19267202c6982b980e736d5a0 (diff) | |
| parent | 534d0cc5070287b221fa77f5dd564dd4544b5780 (diff) | |
Merge branch 'master' into profit-tests
Diffstat (limited to 'frontend/src/SECAPIData.js')
| -rw-r--r-- | frontend/src/SECAPIData.js | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/frontend/src/SECAPIData.js b/frontend/src/SECAPIData.js deleted file mode 100644 index 8d0611f..0000000 --- a/frontend/src/SECAPIData.js +++ /dev/null @@ -1,44 +0,0 @@ -import React, {useState, useEffect} from 'react'; -import Button from './Button'; -import HubList from './HubList'; -import DateInput from './DateInput'; - - - -function SECAPIData() { - const [displayData, setDisplayData] = useState({}); - const [startDate, setStartDate] = useState(""); - const [endDate, setEndDate] = useState(""); - - const toEpochMilli = date => Date.parse(date); - - const getLinks = () => { - fetch("http://localhost:4567/data", { - method: "POST", - body: JSON.stringify( - { - "start" : toEpochMilli(startDate), - "end" : toEpochMilli(endDate) - }), - headers: { - "Content-Type": "application/json", - }, - credentials: "same-origin" - }) - .then(res => res.json()) - .then(data => setDisplayData(data)) - .catch(err => console.log(err)); - } - - return ( - <div> - <h1>SECAPIData</h1> - <DateInput setStart={setStartDate} setEnd={setEndDate}></DateInput> - <Button onPress={getLinks}></Button> - <HubList data={displayData}></HubList> - </div> - ); -} - -export default SECAPIData; -
\ No newline at end of file |
