feat: persist the queue in the localStorage

This commit is contained in:
Deluan
2020-03-31 14:27:39 -04:00
parent 083a11a563
commit 7fec503b72
6 changed files with 25 additions and 24 deletions
+8 -2
View File
@@ -1,4 +1,6 @@
const subsonicUrl = (command, id, options) => {
import { fetchUtils } from 'react-admin'
const url = (command, id, options) => {
const params = new URLSearchParams()
params.append('u', localStorage.getItem('username'))
params.append('t', localStorage.getItem('subsonic-token'))
@@ -19,4 +21,8 @@ const subsonicUrl = (command, id, options) => {
return `rest/${command}?${params.toString()}`
}
export { subsonicUrl }
const scrobble = (id, submit) => {
return fetchUtils.fetchJson(url('scrobble', id, { submission: submit }))
}
export default { url, scrobble }