Skip to content

Commit

Permalink
taking inputinto account
Browse files Browse the repository at this point in the history
  • Loading branch information
jeandtx committed Oct 28, 2023
1 parent a7bf94a commit 4d5874d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/components/PageSelector/PageSelector.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,15 @@ const PageSelector = () => {
const handleAPICall = () => {

const maxTimeout = 350000;
console.log('API call started.');
const apiCallPromise = fetch('http://13.38.95.183/predict?title=Stole%20the%20show&artist=Kygo&nb_of_recommendations=10')
console.log('API call started. With following parameters: ');
console.log('Song: ', song);
console.log('Artist: ', artist);

const numberOfRecommendations = 10; // Replace with your desired number of recommendations
const apiUrl = `http://13.38.95.183/predict?title=${encodeURIComponent(song)}&artist=${encodeURIComponent(artist)}&nb_of_recommendations=${numberOfRecommendations}`;


const apiCallPromise = fetch(apiUrl)
.then(response => response.json())
.then(data => {
// Check if the API response contains data
Expand Down

0 comments on commit 4d5874d

Please sign in to comment.