Merging actions into unifed format

This commit is contained in:
James Barnsley
2017-09-04 08:17:28 +12:00
parent 425326a46e
commit e7f3f689ea
4 changed files with 145 additions and 159 deletions

View File

@ -446,6 +446,8 @@ export function getURL( url, action_name, key = false ){
export function getSearchResults(query, type = 'album,artist,playlist,track', limit = 50, offset = 0){
return (dispatch, getState) => {
dispatch(uiActions.startProcess('SPOTIFY_GET_SEARCH_RESULTS_PROCESSOR','Searching Spotify'))
var url = 'search?q='+query
url += '&type='+type
url += '&country='+getState().core.country
@ -508,6 +510,8 @@ export function getSearchResults(query, type = 'album,artist,playlist,track', li
results: response.tracks.items,
more: response.tracks.next,
});
dispatch(uiActions.processFinished('SPOTIFY_GET_SEARCH_RESULTS_PROCESSOR'))
});
}
}