(service: SpotifyService, deviceId: string)
| 400 | } |
| 401 | |
| 402 | export async function next(service: SpotifyService, deviceId: string) { |
| 403 | const config = { |
| 404 | headers: { |
| 405 | Authorization: `Bearer ${service.retrieveUser().token}`, |
| 406 | }, |
| 407 | }; |
| 408 | try { |
| 409 | const spotifyResult = await axios.post( |
| 410 | `https://api.spotify.com/v1/me/player/next?device_id=${deviceId}`, |
| 411 | {}, |
| 412 | config |
| 413 | ); |
| 414 | |
| 415 | return spotifyResult.data; |
| 416 | } catch (e) { |
| 417 | if (e instanceof axios.AxiosError) { |
| 418 | console.log(e.message); |
| 419 | } else { |
| 420 | throw e; |
| 421 | } |
| 422 | } |
| 423 | return undefined; |
| 424 | } |
| 425 | |
| 426 | export async function getPlaylists(service: SpotifyService) { |
| 427 | const config = { |
searching dependent graphs…