Adding as an index reference where index uris change
This commit is contained in:
@ -152,6 +152,31 @@ export default function reducer(core = {}, action){
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Remove an item from an index
|
||||
**/
|
||||
|
||||
case 'REMOVE_FROM_INDEX':
|
||||
var index = Object.assign({}, core[action.index_name]);
|
||||
|
||||
// We have a new key to redirect to
|
||||
if (action.new_key){
|
||||
index[action.key] = {
|
||||
moved_to: action.new_key
|
||||
}
|
||||
|
||||
// No redirection, so just a clean delete
|
||||
} else {
|
||||
delete index[action.key];
|
||||
}
|
||||
|
||||
var updated_core = {};
|
||||
updated_core[action.index_name] = index;
|
||||
|
||||
return Object.assign({}, core, updated_core);
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Playlists
|
||||
|
||||
Reference in New Issue
Block a user