simba-mobile-cud/app/redux/reducers/WalletReducer/GetAvisImpositionReducer.js

38 lines
936 B
JavaScript

import * as WalletType from "../../types/WalletType";
const initialState = {
loading: false,
result: null,
error: null
};
export default (state = initialState, action) => {
switch (action.type) {
case WalletType.GET_AVIS_IMPOSITION_PENDING:
return {
...state,
loading: true
}
case WalletType.GET_AVIS_IMPOSITION_SUCCESS:
return {
...state,
loading: false,
result: action.result.data,
error: null
}
case WalletType.GET_AVIS_IMPOSITION_ERROR:
return {
...state,
loading: false,
result: null,
error: action.result
}
case WalletType.GET_AVIS_IMPOSITION_RESET:
return initialState;
default: {
return state;
}
}
};