simba-mobile-cad4/app/redux/reducers/WalletReducer/GetQRCodeDetailReducer.js

45 lines
1.0 KiB
JavaScript
Raw Normal View History

2025-01-07 09:47:45 +00:00
/**
* Project iLinkCity
* File GetQRCodeDetailReducer
* Path redux/reducers/WalletReducer
* Created by BRICE ZELE
* Date: 19/08/2021
*/
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_QR_CODE_DETAIL_PENDING:
return {
...state,
loading: true
}
case WalletType.GET_QR_CODE_DETAIL_SUCCESS:
return {
...state,
loading: false,
result: action.result.data,
error: null
}
case WalletType.GET_QR_CODE_DETAIL_ERROR:
return {
...state,
loading: false,
result: null,
error: action.result
}
case WalletType.GET_QR_CODE_DETAIL_RESET:
return initialState;
default: {
return state;
}
}
};