const BRANCHES_CREATE_REQUEST = "BRANCHES_CREATE_REQUEST";
const BRANCHES_CREATE_SUCCESS = "BRANCHES_CREATE_SUCCESS";
const BRANCHES_CREATE_ERROR = "BRANCHES_CREATE_ERROR";
  
const initialState = {
	data: [],
	createRequestPending: false
}
  
const branchesCreateReducer = (state = initialState, { type, payload }) => {
	switch(type) {
		case BRANCHES_CREATE_REQUEST:
			return {
				...state,
				createRequestPending: true
			};
		case BRANCHES_CREATE_SUCCESS:
			return {
				...state,
				data: payload.data,
				createRequestPending: false
			};
		case BRANCHES_CREATE_ERROR:
			return {
				...state,
				createRequestPending: false
			};
		default:
			return state;
	}
};
  
  export default branchesCreateReducer;