Last active
October 20, 2017 12:30
-
-
Save CaseyHofland/2f719c056b47361518f0f79460ce3adc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
search(term) { | |
console.log(term); | |
$.ajax({ | |
url: spotifyURIBase + `search?type=track&q=${term}`, | |
type: 'GET', | |
dataType: 'json', | |
headers: {Authorization: `Bearer ${accessToken}`}, | |
success(response) { | |
return response.map(track => { | |
ID: track.id; | |
Name: track.name; | |
Artist: track.artists[0].name; | |
Album: track.album; | |
URI: track.uri; | |
}); | |
}, | |
error(jqXHR, status, errorThrown) { | |
console.log('error'); | |
console.log(jqXHR); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment