Something went wrong. Try again.
A decentralized music tracking and discovery platform built on AT Protocol 🎵 forked from rocksky.app/rocksky
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576import axios from "axios";import { API_URL } from "../consts";
export const play = async () => { const response = await axios.put( `${API_URL}/spotify/play`, {}, { headers: { "Content-Type": "application/json", Authorization: `Bearer ${localStorage.getItem("token")}`, }, }, ); return response.data;};
export const pause = async () => { const response = await axios.put( `${API_URL}/spotify/pause`, {}, { headers: { "Content-Type": "application/json", Authorization: `Bearer ${localStorage.getItem("token")}`, }, }, ); return response.data;};
export const next = async () => { const response = await axios.post( `${API_URL}/spotify/next`, {}, { headers: { "Content-Type": "application/json", Authorization: `Bearer ${localStorage.getItem("token")}`, }, }, ); return response.data;};
export const previous = async () => { const response = await axios.post( `${API_URL}/spotify/previous`, {}, { headers: { "Content-Type": "application/json", Authorization: `Bearer ${localStorage.getItem("token")}`, }, }, ); return response.data;};
export const seek = async (position_ms: number) => { const response = await axios.put( `${API_URL}/spotify/seek`, {}, { headers: { "Content-Type": "application/json", Authorization: `Bearer ${localStorage.getItem("token")}`, }, params: { position_ms, }, }, ); return response.data;};