const NOTIFICATION_CREATE_REQUEST = "NOTIFICATION_CREATE_REQUEST";
const NOTIFICATION_CREATE_SUCCESS = "NOTIFICATION_CREATE_SUCCESS";
const NOTIFICATION_CREATE_ERROR = "NOTIFICATION_CREATE_ERROR";
  
const initialState = {
	data: [],
	createRequestPending: false
}
  
const notificationCreateReducer = (state = initialState, { type, payload }) => {
	switch(type) {
		case NOTIFICATION_CREATE_REQUEST:
			return {
				...state,
				createRequestPending: true
			};
		case NOTIFICATION_CREATE_SUCCESS:
			return {
				...state,
				data: payload.data,
				createRequestPending: false
			};
		case NOTIFICATION_CREATE_ERROR:
			return {
				...state,
				createRequestPending: false
			};
		default:
			return state;
	}
};
  
  export default  notificationCreateReducer;