From 974a1fec107515864cfe74375888ae42200a4057 Mon Sep 17 00:00:00 2001 From: Jerzy Kwiatkowski Date: Fri, 12 Jan 2024 10:57:52 +0100 Subject: [PATCH] Small fixes --- react/src/App.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/react/src/App.js b/react/src/App.js index 600006b..f71b4bd 100644 --- a/react/src/App.js +++ b/react/src/App.js @@ -12,22 +12,22 @@ function App() { const [results, setResults] = useState(''); const [isVisible, setIsVisible] = useState(true); - const fetchDataFromAPI = async (dataset, table, column) => { + const fetchDataFromAPI = async (ldataset, ltable, lcolumn, tdataset, ttable, tcolumn) => { try { - const response = await axios.get(`https://cat-fact.herokuapp.com/facts/?dataset=${dataset}&table=${table}&column=${column}`); - const data = response.data; + postML(entryId, ldataset, ltable, lcolumn, tdataset, ttable, tcolumn); - setResults(data); } catch (error) { - console.error('Error fetching data:', error); + console.error('ERROR fetching data:', error); setResults('Error fetching data'); } }; + const handleButtonClick = () => { - fetchDataFromAPI(datasetQuarry, tableQuarry, columns); + fetchDataFromAPI(datasetQuarry2, tableQuarry2, columns2, datasetQuarry, tableQuarry, columns); }; + const toggleVisibility = () => { setIsVisible(!isVisible); };