spotify-web-api-js
spotify-web-api-js copied to clipboard
Add to saved tracks seems to have changed
Describe the bug
I'm using spotify.api.addToMySavedTracks
, but i get a network error (status 400) in the console:
responseText: "{\"error\": {\"status\": 400, \"message\": \"Missing required field: ids\" } }"
It seems that this package sends as payload just an array of ids, but spotify expects this format:
{
"ids": [
"string"
]
}
To Reproduce Steps to reproduce the behavior:
- Run code
spotify.api.addToMySavedTracks([id])
- See network error 400 as described above
Expected behavior
I expect it to not error and use {ids:[]}
as request payload
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: windows
- Browser chrome (electron)
- Version 1.5.2
I'll try to make a pr for it
Source: https://developer.spotify.com/documentation/web-api/reference/save-tracks-user