diff options
| author | clarkohw <66530369+clarkohw@users.noreply.github.com> | 2021-04-19 03:02:45 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-19 03:02:45 -0400 |
| commit | ab4621b0e245043ef60db13e509fdb0c5b4cfc64 (patch) | |
| tree | 7a6c356cca51f4fa4b549c693e168f6fc61302b3 /frontend/src/SECAPIData.js | |
| parent | 0508b076ac948a11bde14cfa9f5261796d890ef2 (diff) | |
| parent | 0466db8b9051cb6300f274f0bba480d1020c63cf (diff) | |
Merge branch 'master' into profit-testing
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 |
