mirror of
https://github.com/strapi/strapi.git
synced 2025-09-26 17:00:55 +00:00
33 lines
659 B
JavaScript
33 lines
659 B
JavaScript
![]() |
/*
|
||
|
*
|
||
|
* InstallPluginPage reducer
|
||
|
*
|
||
|
*/
|
||
|
|
||
|
import { fromJS, List } from 'immutable';
|
||
|
import {
|
||
|
GET_PLUGINS_SUCCEEDED,
|
||
|
ON_CHANGE,
|
||
|
} from './constants';
|
||
|
|
||
|
const initialState = fromJS({
|
||
|
availablePlugins: List([]),
|
||
|
didFetchPlugins: false,
|
||
|
search: '',
|
||
|
});
|
||
|
|
||
|
function installPluginPageReducer(state = initialState, action) {
|
||
|
switch (action.type) {
|
||
|
case GET_PLUGINS_SUCCEEDED:
|
||
|
return state
|
||
|
.set('didFetchPlugins', true)
|
||
|
.set('plugins', List(action.availablePlugins));
|
||
|
case ON_CHANGE:
|
||
|
return state.updateIn(action.keys, () => action.value);
|
||
|
default:
|
||
|
return state;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
export default installPluginPageReducer;
|