mirror of
https://github.com/idanoo/GoScrobble
synced 2025-07-17 13:31:52 +00:00
0.0.19
- Tidy init/goscrobble.service - Add routers for Artist/Album/Track endpoints + basic pages - Move UUID generation into Go so we don't have to query the record!! Wooo!
This commit is contained in:
parent
1c865a6784
commit
99f9e7cfb3
28 changed files with 388 additions and 214 deletions
|
@ -11,6 +11,9 @@ function getHeaders() {
|
|||
if (user.exp < unixtime) {
|
||||
// TODO: Handle expiry nicer
|
||||
toast.warning("Session expired. Please log in again")
|
||||
// localStorage.removeItem('user');
|
||||
// window.location.reload();
|
||||
return {};
|
||||
}
|
||||
|
||||
return { Authorization: 'Bearer ' + user.jwt };
|
||||
|
@ -252,3 +255,30 @@ export const getServerInfo = () => {
|
|||
return handleErrorResp(error)
|
||||
});
|
||||
}
|
||||
|
||||
export const getArtist = (uuid) => {
|
||||
return axios.get(process.env.REACT_APP_API_URL + "artist/" + uuid).then(
|
||||
(data) => {
|
||||
return data.data;
|
||||
}).catch((error) => {
|
||||
return handleErrorResp(error)
|
||||
});
|
||||
};
|
||||
|
||||
export const getAlbum = (uuid) => {
|
||||
return axios.get(process.env.REACT_APP_API_URL + "album/" + uuid).then(
|
||||
(data) => {
|
||||
return data.data;
|
||||
}).catch((error) => {
|
||||
return handleErrorResp(error)
|
||||
});
|
||||
};
|
||||
|
||||
export const getTrack = (uuid) => {
|
||||
return axios.get(process.env.REACT_APP_API_URL + "track/" + uuid).then(
|
||||
(data) => {
|
||||
return data.data;
|
||||
}).catch((error) => {
|
||||
return handleErrorResp(error)
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue