forked from avvazana/Spoofify
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
197 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
|
||
json.array! @albums do |album| | ||
json.id album.id | ||
json.title album.title | ||
json.summary album.summary | ||
json.audio album.enclosure_url | ||
json.itunes_author album.itunes_author | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import * as SearchApiUtil from '../util/search_api_util'; | ||
|
||
export const RECEIVE_ALL_ALBUMS = 'RECEIVE_ALL_ALBUMS'; | ||
export const RECEIVE_ALBUM = 'RECEIVE_ALBUM'; | ||
|
||
export const requestAllAlbums = (searchQuery) => { | ||
|
||
return (dispatch) => { | ||
|
||
return SearchApiUtil.fetchAllAlbums(searchQuery) | ||
.then(null, | ||
(response) => { | ||
dispatch(receiveAllAlbums(JSON.parse(response.responseText).results)); | ||
}); | ||
}; | ||
}; | ||
|
||
export const requestSingleAlbum = (searchQuery) => { | ||
return (dispatch) => { | ||
return SearchApiUtil.fetchSingleAlbum(searchQuery) | ||
.then(null, | ||
(response) => { | ||
dispatch(receiveSingleAlbum(JSON.parse(response.responseText).results[0])); | ||
}); | ||
}; | ||
}; | ||
|
||
export const receiveAllAlbums = (albums) => { | ||
|
||
return { | ||
type: RECEIVE_ALL_ALBUMS, | ||
albums | ||
}; | ||
}; | ||
|
||
export const receiveSingleAlbum = (album) => { | ||
return { | ||
type: RECEIVE_ALBUM, | ||
album | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// import { RECEIVE_ALL_ALBUMS, RECEIVE_ALBUM } from '../../actions/search_actions'; | ||
// import { merge } from 'lodash'; | ||
// | ||
// export default (state = {}, action) => { | ||
// | ||
// switch (action.type) { | ||
// case RECEIVE_ALL_ALBUMS: | ||
// const newState = merge({}, state); | ||
// action.albums.map((album) => newState[album.collectionName] = album ); | ||
// return newState; | ||
// case RECEIVE_ALBUM: | ||
// const otherNewState = merge({}, state); | ||
// otherNewState[action.album.collectionName] = action.album; | ||
// return otherNewState; | ||
// default: | ||
// return state; | ||
// } | ||
// }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export const fetchAlbums = (props) => { | ||
|
||
return $.ajax({ | ||
method: 'GET', | ||
url: '/api/albums', | ||
|
Oops, something went wrong.