diff --git a/src/App.js b/src/App.js index 58ece28..c92b296 100644 --- a/src/App.js +++ b/src/App.js @@ -1,5 +1,6 @@ import './App.css'; import { useState } from 'react'; +import axios from 'axios'; function App() { const [datasetQuarry, setDatasetQuarry] = useState(''); @@ -7,10 +8,23 @@ function App() { const [columns, setColumns] = useState(''); const [results, setResults] = useState(''); - const handleButtonClick = () => { - - setResults('Tutaj możesz umieścić swoje wyniki.'); + const fetchDataFromAPI = async (dataset, table, column) => { + try { + const response = await axios.get(`YOUR_API_ENDPOINT?dataset=${dataset}&table=${table}&column=${column}`); + const data = response.data; + + setResults(data); + } catch (error) { + console.error('Error fetching data:', error); + setResults('Error fetching data'); + } }; + + const handleButtonClick = () => { + // Call the API request function with the provided parameters + fetchDataFromAPI(datasetQuarry, tableQuarry, columns); + }; + return (
- // Edit src/App.js
and save to reload.
- //