mirror of
https://github.com/astuto/astuto.git
synced 2025-12-15 03:07:52 +01:00
68 lines
1.9 KiB
TypeScript
68 lines
1.9 KiB
TypeScript
import {
|
|
PostStatusOrderUpdateActionTypes,
|
|
POSTSTATUS_ORDER_UPDATE_START,
|
|
POSTSTATUS_ORDER_UPDATE_SUCCESS,
|
|
POSTSTATUS_ORDER_UPDATE_FAILURE,
|
|
} from '../actions/PostStatus/updatePostStatusOrder';
|
|
|
|
import {
|
|
PostStatusDeleteActionTypes,
|
|
POST_STATUS_DELETE_START,
|
|
POST_STATUS_DELETE_SUCCESS,
|
|
POST_STATUS_DELETE_FAILURE,
|
|
} from '../actions/PostStatus/deletePostStatus';
|
|
|
|
import {
|
|
PostStatusSubmitActionTypes,
|
|
POSTSTATUS_SUBMIT_START,
|
|
POSTSTATUS_SUBMIT_SUCCESS,
|
|
POSTSTATUS_SUBMIT_FAILURE,
|
|
} from '../actions/PostStatus/submitPostStatus';
|
|
|
|
import {
|
|
PostStatusUpdateActionTypes,
|
|
POSTSTATUS_UPDATE_START,
|
|
POSTSTATUS_UPDATE_SUCCESS,
|
|
POSTSTATUS_UPDATE_FAILURE,
|
|
} from '../actions/PostStatus/updatePostStatus';
|
|
|
|
import siteSettingsPostStatusesReducer, { SiteSettingsPostStatusesState } from './SiteSettings/postStatusesReducer';
|
|
|
|
interface SiteSettingsState {
|
|
postStatuses: SiteSettingsPostStatusesState;
|
|
}
|
|
|
|
const initialState: SiteSettingsState = {
|
|
postStatuses: siteSettingsPostStatusesReducer(undefined, {} as any),
|
|
};
|
|
|
|
const siteSettingsReducer = (
|
|
state = initialState,
|
|
action: PostStatusOrderUpdateActionTypes |
|
|
PostStatusDeleteActionTypes |
|
|
PostStatusSubmitActionTypes |
|
|
PostStatusUpdateActionTypes
|
|
): SiteSettingsState => {
|
|
switch (action.type) {
|
|
case POSTSTATUS_ORDER_UPDATE_START:
|
|
case POSTSTATUS_ORDER_UPDATE_SUCCESS:
|
|
case POSTSTATUS_ORDER_UPDATE_FAILURE:
|
|
case POST_STATUS_DELETE_START:
|
|
case POST_STATUS_DELETE_SUCCESS:
|
|
case POST_STATUS_DELETE_FAILURE:
|
|
case POSTSTATUS_SUBMIT_START:
|
|
case POSTSTATUS_SUBMIT_SUCCESS:
|
|
case POSTSTATUS_SUBMIT_FAILURE:
|
|
case POSTSTATUS_UPDATE_START:
|
|
case POSTSTATUS_UPDATE_SUCCESS:
|
|
case POSTSTATUS_UPDATE_FAILURE:
|
|
return {
|
|
postStatuses: siteSettingsPostStatusesReducer(state.postStatuses, action)
|
|
};
|
|
|
|
default:
|
|
return state;
|
|
}
|
|
};
|
|
|
|
export default siteSettingsReducer; |