simba-mobile-cad4/app/redux/reducers/CasserEpargneUserReducer.js

34 lines
948 B
JavaScript
Raw Permalink Normal View History

2025-01-07 09:47:45 +00:00
import { CASSER_EPARGNE_USER_PENDING, CASSER_EPARGNE_USER_SUCCESS, CASSER_EPARGNE_USER_ERROR, CASSER_EPARGNE_USER_RESET } from "../types/NanoCreditType";
const initialState = {
loading: false,
result: null,
error: null
};
export default (state = initialState, action) => {
switch (action.type) {
case CASSER_EPARGNE_USER_PENDING: return {
...state,
loading: true
}
case CASSER_EPARGNE_USER_SUCCESS: return {
...state,
loading: false,
result: action.result.data,
error: null
}
case CASSER_EPARGNE_USER_ERROR: return {
...state,
loading: false,
result: null,
error: action.result
}
case CASSER_EPARGNE_USER_RESET: return initialState;
default: {
return state;
}
}
};