diff --git a/src/App.jsx b/src/App.jsx index 480d03d..4d00854 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -10,6 +10,10 @@ import { addMoneyToWallet as addMoneyService } from './services/apiService.jsx'; +import { + madeRecommendations +} from './workers-functions.js'; + function App() { const { loginWithRedirect, logout, isAuthenticated, user, getAccessTokenSilently } = useAuth0(); const [fixtures, setFixtures] = useState([]); @@ -231,13 +235,19 @@ function App() { } }; + const makeRecommendations = async () => { + let userId = localStorage.getItem('userId'); + const result = await madeRecommendations(userId); + console.log(result); + }; + + const handleShowResultsClick = () => { + // Code to show results + }; + return (
-
- {isAuthenticated ? ( - <> - {user.name} -

Welcome, {user.name}

+
@@ -253,6 +263,10 @@ function App() {

Worker Status: {workerAvailable ? 'Available' : 'Unavailable'}

+
+ +
+
{ + const response = await axios.get(`https://nodecraft.me/fixtures/${fixture}`); + // Do something with the response + return response.data; // Return the response data if needed + }); + + const responses = await Promise.all(requests); + return responses; +} + +async function getHistory(id) { + const response = await axios.get(`https://nodecraft.me/recommendations/${id}/history`); + const filteredData = response.data.filter(item => item.response != {}); + console.log(filteredData); + return filteredData; +} + +async function madeRecommendations(id) { + const job = await postRecomendations(id); + const data = await getRecomendations(id); + const result = await Recommendations(data); + return result; +} + + +//console.log(await Recommendations(fixtures)); + + + +export { + getHistory, + madeRecommendations +}; \ No newline at end of file