UI actions; Context menu
This commit is contained in:
@ -405,7 +405,7 @@ export function getCategory( id ){
|
||||
}
|
||||
|
||||
export function getCategoryPlaylists( id ){
|
||||
return (dispatch, getState) => {
|
||||
return (dispatch, getState) => {
|
||||
|
||||
dispatch({ type: 'SPOTIFY_CATEGORY_PLAYLISTS_LOADED', data: false });
|
||||
|
||||
@ -416,6 +416,21 @@ export function getCategoryPlaylists( id ){
|
||||
data: response.playlists
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export function getNewReleases(){
|
||||
return (dispatch, getState) => {
|
||||
|
||||
dispatch({ type: 'SPOTIFY_NEW_RELEASES_LOADED', data: false });
|
||||
|
||||
sendRequest( dispatch, getState, 'browse/new-releases?country='+getState().spotify.country+'&limit=50' )
|
||||
.then( response => {
|
||||
dispatch({
|
||||
type: 'SPOTIFY_NEW_RELEASES_LOADED',
|
||||
data: response.albums
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -82,6 +82,9 @@ export default function reducer(spotify = {}, action){
|
||||
case 'SPOTIFY_CATEGORY_PLAYLISTS_LOADED':
|
||||
return Object.assign({}, spotify, { category_playlists: action.data });
|
||||
|
||||
case 'SPOTIFY_NEW_RELEASES_LOADED':
|
||||
return Object.assign({}, spotify, { new_releases: action.data });
|
||||
|
||||
default:
|
||||
return spotify
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user