simba-mobile-cad3/app/redux/reducers/WalletReducer/ModifyPenalityReducer.js

38 lines
920 B
JavaScript
Raw Normal View History

2025-01-07 09:47:45 +00:00
import * as WalletType from "../../types/WalletType";
const initialState = {
loading: false,
result: null,
error: null
};
export default (state = initialState, action) => {
switch (action.type) {
case WalletType.MODIFY_PENALITY_PENDING:
return {
...state,
loading: true
}
case WalletType.MODIFY_PENALITY_SUCCESS:
return {
...state,
loading: false,
result: action.result.data,
error: null
}
case WalletType.MODIFY_PENALITY_ERROR:
return {
...state,
loading: false,
result: null,
error: action.result
}
case WalletType.MODIFY_PENALITY_RESET:
return initialState;
default: {
return state;
}
}
};