(token)
| 18 | |
| 19 | //Function to get Genres |
| 20 | const _getGenres = async (token) => { |
| 21 | const result = await fetch( |
| 22 | `https://api.spotify.com/v1/browse/categories?locale=sv_US`, |
| 23 | { |
| 24 | method: 'GET', |
| 25 | headers: { Authorization: 'Bearer ' + token }, |
| 26 | }, |
| 27 | ) |
| 28 | |
| 29 | const data = await result.json() |
| 30 | return data.categories.items |
| 31 | } |
| 32 | |
| 33 | //Function to get playlist by selected genre |
| 34 | const _getPlaylistByGenre = async (token, genreId) => { |