soportes.js
559 Bytes
import { merge } from 'ramda'
import {
REQUEST_SOPORTES,
RECEIVE_SOPORTES,
} from '../actions/soportes'
const soportes = {
data: [],
current: null,
loading: true,
pages: null,
busqueda: { page: 1, text: '' },
}
export default (state, action) => {
switch (action.type) {
case REQUEST_SOPORTES:
return merge(state, { loading: true, pages: null })
case RECEIVE_SOPORTES:
return merge(
state,
{ loading: false, data: action.soportes, pages: action.pages })
default:
return state || soportes
}
}