mirror of
https://github.com/strapi/strapi.git
synced 2025-09-15 19:39:06 +00:00
23 lines
521 B
JavaScript
23 lines
521 B
JavaScript
import { fromJS } from 'immutable';
|
|
|
|
const initialState = fromJS({
|
|
initialWebhook: {},
|
|
modifiedWebhook: {},
|
|
shouldRefetchData: false,
|
|
});
|
|
|
|
const reducer = (state, action) => {
|
|
switch (action.type) {
|
|
case 'GET_DATA_SUCCEEDED':
|
|
return state
|
|
.update('initialWebhook', () => fromJS(action.data))
|
|
.update('modifiedWebhook', () => fromJS(action.data))
|
|
.update('shouldRefetchData', () => false);
|
|
default:
|
|
return state;
|
|
}
|
|
};
|
|
|
|
export default reducer;
|
|
export { initialState };
|