Correction de quelques bugs et recherche d'utilisateur sur la carte
This commit is contained in:
parent
a95dfc6d01
commit
0273273b8a
File diff suppressed because one or more lines are too long
|
@ -628,7 +628,7 @@
|
||||||
"LONGUE": "Longue",
|
"LONGUE": "Longue",
|
||||||
"ACCIDENT": "Accident",
|
"ACCIDENT": "Accident",
|
||||||
"GROSSESSE": "Grossesse",
|
"GROSSESSE": "Grossesse",
|
||||||
"ADD_PRESTATION": "Ajouter une prestation",
|
"ADD_PRESTATION": "Ajouter une consultation",
|
||||||
"ADD_PRESCRIPTION": "Ajouter une prescription",
|
"ADD_PRESCRIPTION": "Ajouter une prescription",
|
||||||
"VISITE_DOMICILE": "Visite domicile ",
|
"VISITE_DOMICILE": "Visite domicile ",
|
||||||
"CODE_ACTE": "Code acte ",
|
"CODE_ACTE": "Code acte ",
|
||||||
|
@ -653,7 +653,7 @@
|
||||||
"CLASSE_PRESTATAIRE": "Classe de prestataire",
|
"CLASSE_PRESTATAIRE": "Classe de prestataire",
|
||||||
"FRAIS_DEPLACEMENT": "Frais de déplacement",
|
"FRAIS_DEPLACEMENT": "Frais de déplacement",
|
||||||
"AJOUTER_MEDICAMENT": "Ajouter médicament/appareil",
|
"AJOUTER_MEDICAMENT": "Ajouter médicament/appareil",
|
||||||
"AJOUTER_EXAMEN": "Ajouter examen",
|
"AJOUTER_EXAMEN": "Ajouter autre acte ou examen",
|
||||||
"NAME": "Nom",
|
"NAME": "Nom",
|
||||||
"POSOLOGIE": "Posologie",
|
"POSOLOGIE": "Posologie",
|
||||||
"QUANTITE": "Quantité",
|
"QUANTITE": "Quantité",
|
||||||
|
@ -689,8 +689,8 @@
|
||||||
"MODIFIER_EXAMEN": "Modifier examen",
|
"MODIFIER_EXAMEN": "Modifier examen",
|
||||||
"EXAMENS_SUCCESSFULLY_MODIFY": "Examen modifié avec succès",
|
"EXAMENS_SUCCESSFULLY_MODIFY": "Examen modifié avec succès",
|
||||||
"PRESTATION_SUCCESSFULLY_MODIFY": "Prestation modifié avec succès",
|
"PRESTATION_SUCCESSFULLY_MODIFY": "Prestation modifié avec succès",
|
||||||
"MODIFY_PRESTATION": "Modifier une prestation",
|
"MODIFY_PRESTATION": "Modifier une consultation",
|
||||||
"LIST_PRESTATION": "Liste des prestations",
|
"LIST_PRESTATION": "Liste des consultations",
|
||||||
"NO_CONSULTATION": "Aucune consultation",
|
"NO_CONSULTATION": "Aucune consultation",
|
||||||
"NO_EXECUTION": "Aucune exécution",
|
"NO_EXECUTION": "Aucune exécution",
|
||||||
"LISTE_CONSULTATION": "Liste des consultations",
|
"LISTE_CONSULTATION": "Liste des consultations",
|
||||||
|
@ -725,5 +725,17 @@
|
||||||
"ECH": "Ech.",
|
"ECH": "Ech.",
|
||||||
"PER": "Per.",
|
"PER": "Per.",
|
||||||
"ASSURE_SUSPENDU": "Cet assuré est suspendu",
|
"ASSURE_SUSPENDU": "Cet assuré est suspendu",
|
||||||
"ASSURE_PRINCIPAL_SUSPENDU": "L'assuré principal est suspendu"
|
"ASSURE_PRINCIPAL_SUSPENDU": "L'assuré principal est suspendu",
|
||||||
|
"CONSULTATION": "Consultation",
|
||||||
|
"ACTE_EXAMEN": "Autre acte et examen",
|
||||||
|
"AMOUNT_FREE": "Montant libre",
|
||||||
|
"DESCRIPTION": "Description",
|
||||||
|
"EXECUTION": "Execution",
|
||||||
|
"UNIT_QUANTITE": "Qté unitaire",
|
||||||
|
"NO_USAGER_CORRESPONDING_TO_SEARCH": "Aucun usager ne correspond à votre recherche",
|
||||||
|
"USAGER_SEARCH": "Recherche d'un usager",
|
||||||
|
"BY_NAME": "Par nom",
|
||||||
|
"BY_QR_CODE": "Par QR Code",
|
||||||
|
"SCAN": "Scanner",
|
||||||
|
"BRING_YOUR_CAMERA_CLOSER_TO_SCAN_QR_CODE": "Approchez votre caméra du QR Code afin de le scanner"
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,10 @@ import {
|
||||||
GET_OPERATOR_LIST_PENDING,
|
GET_OPERATOR_LIST_PENDING,
|
||||||
GET_OPERATOR_LIST_RESET,
|
GET_OPERATOR_LIST_RESET,
|
||||||
GET_OPERATOR_LIST_SUCCESS,
|
GET_OPERATOR_LIST_SUCCESS,
|
||||||
|
GET_QR_CODE_DETAIL_ERROR,
|
||||||
|
GET_QR_CODE_DETAIL_PENDING,
|
||||||
|
GET_QR_CODE_DETAIL_RESET,
|
||||||
|
GET_QR_CODE_DETAIL_SUCCESS,
|
||||||
LINK_CARD_ERROR,
|
LINK_CARD_ERROR,
|
||||||
LINK_CARD_PENDING,
|
LINK_CARD_PENDING,
|
||||||
LINK_CARD_RESET,
|
LINK_CARD_RESET,
|
||||||
|
@ -19,6 +23,10 @@ import {
|
||||||
REATTACH_ACCOUNT_PENDING,
|
REATTACH_ACCOUNT_PENDING,
|
||||||
REATTACH_ACCOUNT_RESET,
|
REATTACH_ACCOUNT_RESET,
|
||||||
REATTACH_ACCOUNT_SUCCESS,
|
REATTACH_ACCOUNT_SUCCESS,
|
||||||
|
SEARCH_USER_ERROR,
|
||||||
|
SEARCH_USER_PENDING,
|
||||||
|
SEARCH_USER_RESET,
|
||||||
|
SEARCH_USER_SUCCESS,
|
||||||
WALLET_GET_COMMISSION_ERROR,
|
WALLET_GET_COMMISSION_ERROR,
|
||||||
WALLET_GET_COMMISSION_PENDING,
|
WALLET_GET_COMMISSION_PENDING,
|
||||||
WALLET_GET_COMMISSION_RESET,
|
WALLET_GET_COMMISSION_RESET,
|
||||||
|
@ -276,3 +284,38 @@ export const fetchPayBillError = (error) => ({
|
||||||
type: PAY_BILL_ERROR,
|
type: PAY_BILL_ERROR,
|
||||||
result: error
|
result: error
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ---------------------------------------------------
|
||||||
|
*/
|
||||||
|
export const fetchSearchUserPending = () => ({
|
||||||
|
type: SEARCH_USER_PENDING
|
||||||
|
});
|
||||||
|
export const fetchSearchUserReset = () => ({
|
||||||
|
type: SEARCH_USER_RESET
|
||||||
|
});
|
||||||
|
export const fetchSearchUserSuccess = (res) => ({
|
||||||
|
type: SEARCH_USER_SUCCESS,
|
||||||
|
result: res,
|
||||||
|
});
|
||||||
|
export const fetchSearchUserError = (error) => ({
|
||||||
|
type: SEARCH_USER_ERROR,
|
||||||
|
result: error
|
||||||
|
});
|
||||||
|
/**
|
||||||
|
* ---------------------------------------------------
|
||||||
|
*/
|
||||||
|
export const fetchGetQRCodeDetailPending = () => ({
|
||||||
|
type: GET_QR_CODE_DETAIL_PENDING
|
||||||
|
});
|
||||||
|
export const fetchGetQRCodeDetailReset = () => ({
|
||||||
|
type: GET_QR_CODE_DETAIL_RESET
|
||||||
|
});
|
||||||
|
export const fetchGetQRCodeDetailSuccess = (res) => ({
|
||||||
|
type: GET_QR_CODE_DETAIL_SUCCESS,
|
||||||
|
result: res,
|
||||||
|
});
|
||||||
|
export const fetchGetQRCodeDetailError = (error) => ({
|
||||||
|
type: GET_QR_CODE_DETAIL_ERROR,
|
||||||
|
result: error
|
||||||
|
});
|
||||||
|
|
|
@ -0,0 +1,44 @@
|
||||||
|
/**
|
||||||
|
* 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
|
@ -0,0 +1,44 @@
|
||||||
|
/**
|
||||||
|
* Project iLinkCity
|
||||||
|
* File SearchUserReducer
|
||||||
|
* Path redux/reducers/WalletReducer
|
||||||
|
* Created by BRICE ZELE
|
||||||
|
* Date: 26/07/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.SEARCH_USER_PENDING:
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
loading: true
|
||||||
|
}
|
||||||
|
case WalletType.SEARCH_USER_SUCCESS:
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
loading: false,
|
||||||
|
result: action.result.data,
|
||||||
|
error: null
|
||||||
|
}
|
||||||
|
case WalletType.SEARCH_USER_ERROR:
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
loading: false,
|
||||||
|
result: null,
|
||||||
|
error: action.result
|
||||||
|
}
|
||||||
|
case WalletType.SEARCH_USER_RESET:
|
||||||
|
return initialState;
|
||||||
|
|
||||||
|
default: {
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
|
@ -54,10 +54,13 @@ import {
|
||||||
acceptOrRejectConsultationReducer,
|
acceptOrRejectConsultationReducer,
|
||||||
activatePaySubscriptionReducer,
|
activatePaySubscriptionReducer,
|
||||||
addBeneficiaryToSubscriptionReducer,
|
addBeneficiaryToSubscriptionReducer,
|
||||||
addDrugReducer, checkInsuranceCoverageAmountReducer,
|
addDrugReducer,
|
||||||
createConsultationReducer, deleteBeneficiaryeducer,
|
checkInsuranceCoverageAmountReducer,
|
||||||
|
createConsultationReducer,
|
||||||
|
deleteBeneficiaryeducer,
|
||||||
demandeAutorisationSoinReducer,
|
demandeAutorisationSoinReducer,
|
||||||
executionPrescriptionReducer, facturerSoinReducer,
|
executionPrescriptionReducer,
|
||||||
|
facturerSoinReducer,
|
||||||
getAmountConsultationReducer,
|
getAmountConsultationReducer,
|
||||||
getConsultationReducer,
|
getConsultationReducer,
|
||||||
getDrugAppareilReducer,
|
getDrugAppareilReducer,
|
||||||
|
@ -66,12 +69,16 @@ import {
|
||||||
getProviderClassReducer,
|
getProviderClassReducer,
|
||||||
getSubscriptionListReducer,
|
getSubscriptionListReducer,
|
||||||
getUserByIdQRCodeReducer,
|
getUserByIdQRCodeReducer,
|
||||||
getUserByNameOrNumberReducer, insuranceHistoryReducer,
|
getUserByNameOrNumberReducer,
|
||||||
|
insuranceHistoryReducer,
|
||||||
insuranceListReducer,
|
insuranceListReducer,
|
||||||
modifyPrescriptionReducer, stopSubscriptionReducer,
|
modifyPrescriptionReducer,
|
||||||
|
stopSubscriptionReducer,
|
||||||
subscribeInsuranceReducer,
|
subscribeInsuranceReducer,
|
||||||
uploadInsuranceImagesReducer
|
uploadInsuranceImagesReducer
|
||||||
} from "../insurance/insurance.reducer";
|
} from "../insurance/insurance.reducer";
|
||||||
|
import SearchUserReducer from "./SearchUserReducer";
|
||||||
|
import GetQRCodeDetailReducer from "./GetQRCodeDetailReducer";
|
||||||
|
|
||||||
const persistConfig = {
|
const persistConfig = {
|
||||||
key: 'root',
|
key: 'root',
|
||||||
|
@ -182,7 +189,9 @@ const rootReducer = persistCombineReducers(persistConfig, {
|
||||||
deleteBeneficiaryeducer: deleteBeneficiaryeducer,
|
deleteBeneficiaryeducer: deleteBeneficiaryeducer,
|
||||||
facturerSoinReducer: facturerSoinReducer,
|
facturerSoinReducer: facturerSoinReducer,
|
||||||
insuranceHistoryReducer: insuranceHistoryReducer,
|
insuranceHistoryReducer: insuranceHistoryReducer,
|
||||||
checkInsuranceCoverageAmountReducer: checkInsuranceCoverageAmountReducer
|
checkInsuranceCoverageAmountReducer: checkInsuranceCoverageAmountReducer,
|
||||||
|
searchUserReducer: SearchUserReducer,
|
||||||
|
getQRCodeDetailReducer: GetQRCodeDetailReducer,
|
||||||
});
|
});
|
||||||
|
|
||||||
export default rootReducer;
|
export default rootReducer;
|
||||||
|
|
|
@ -57,3 +57,14 @@ export const PAY_BILL_PENDING = 'PAY_BILL_PENDING';
|
||||||
export const PAY_BILL_SUCCESS = 'PAY_BILL_SUCCESS';
|
export const PAY_BILL_SUCCESS = 'PAY_BILL_SUCCESS';
|
||||||
export const PAY_BILL_ERROR = 'PAY_BILL_ERROR';
|
export const PAY_BILL_ERROR = 'PAY_BILL_ERROR';
|
||||||
export const PAY_BILL_RESET = 'PAY_BILL_RESET';
|
export const PAY_BILL_RESET = 'PAY_BILL_RESET';
|
||||||
|
|
||||||
|
|
||||||
|
export const SEARCH_USER_PENDING = 'SEARCH_USER_PENDING';
|
||||||
|
export const SEARCH_USER_SUCCESS = 'SEARCH_USER_SUCCESS';
|
||||||
|
export const SEARCH_USER_ERROR = 'SEARCH_USER_ERROR';
|
||||||
|
export const SEARCH_USER_RESET = 'SEARCH_USER_RESET';
|
||||||
|
|
||||||
|
export const GET_QR_CODE_DETAIL_PENDING = 'GET_QR_CODE_DETAIL_PENDING';
|
||||||
|
export const GET_QR_CODE_DETAIL_SUCCESS = 'GET_QR_CODE_DETAIL_SUCCESS';
|
||||||
|
export const GET_QR_CODE_DETAIL_ERROR = 'GET_QR_CODE_DETAIL_ERROR';
|
||||||
|
export const GET_QR_CODE_DETAIL_RESET = 'GET_QR_CODE_DETAIL_RESET';
|
||||||
|
|
|
@ -13,6 +13,7 @@ import {
|
||||||
PermissionsAndroid,
|
PermissionsAndroid,
|
||||||
Platform,
|
Platform,
|
||||||
ProgressBarAndroid,
|
ProgressBarAndroid,
|
||||||
|
ScrollView,
|
||||||
StatusBar,
|
StatusBar,
|
||||||
StyleSheet,
|
StyleSheet,
|
||||||
Text,
|
Text,
|
||||||
|
@ -49,11 +50,23 @@ import MarkerManager from './../../webservice/persistences/MarkerManager'
|
||||||
import {bindActionCreators} from 'redux';
|
import {bindActionCreators} from 'redux';
|
||||||
import getAuthApiKey from '../../webservice/AuthKeyApi';
|
import getAuthApiKey from '../../webservice/AuthKeyApi';
|
||||||
import {connect} from 'react-redux';
|
import {connect} from 'react-redux';
|
||||||
import getWalletActivated from '../../webservice/WalletApi';
|
import getWalletActivated, {
|
||||||
|
getQRCodeDetailAction,
|
||||||
|
getQRCodeDetailReset,
|
||||||
|
searchUserAction,
|
||||||
|
searchUserReset
|
||||||
|
} from '../../webservice/WalletApi';
|
||||||
import {saveOnesignalIdsAction, saveOnesignalIdsReset} from '../../webservice/OnesignalApi';
|
import {saveOnesignalIdsAction, saveOnesignalIdsReset} from '../../webservice/OnesignalApi';
|
||||||
import OneSignal from 'react-native-onesignal';
|
import OneSignal from 'react-native-onesignal';
|
||||||
import {saveOnesignalIds} from '../../webservice/IlinkConstants';
|
import {saveOnesignalIds} from '../../webservice/IlinkConstants';
|
||||||
import {callingCodes} from "@ideditor/country-coder";
|
import {callingCodes} from "@ideditor/country-coder";
|
||||||
|
import TextInput from "../../components/TextInput";
|
||||||
|
import FontAwesome from "react-native-vector-icons/FontAwesome";
|
||||||
|
import FontAwesomeIcon from "react-native-vector-icons/FontAwesome";
|
||||||
|
import {Color} from "../../config/Color";
|
||||||
|
import QRCodeScanner from "react-native-qrcode-scanner";
|
||||||
|
import Dialog from "react-native-dialog";
|
||||||
|
import {Typography} from "../../config/typography";
|
||||||
|
|
||||||
const countries = require("./../../utils/country_code.json")
|
const countries = require("./../../utils/country_code.json")
|
||||||
|
|
||||||
|
@ -339,6 +352,42 @@ class Home extends BaseScreen {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
componentWillReceiveProps(nextProps) {
|
||||||
|
if (nextProps.resultSearchUserByName !== null) {
|
||||||
|
this.setState({displayDialogResultSearch: true});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nextProps.resultGetQRCodeDetail !== null) {
|
||||||
|
if (nextProps.resultGetQRCodeDetail.response !== null) {
|
||||||
|
this.setState({userName: '' + nextProps.resultGetQRCodeDetail.response.phone})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nextProps.errorGetQRCodeDetail !== null) {
|
||||||
|
if (typeof nextProps.errorGetQRCodeDetail.data !== 'undefined') {
|
||||||
|
Alert.alert(
|
||||||
|
I18n.t("ERROR_LABEL"),
|
||||||
|
nextProps.errorGetQRCodeDetail.data.error,
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
this.setState({
|
||||||
|
displayPhoneField: false,
|
||||||
|
userName: ''
|
||||||
|
});
|
||||||
|
this.props.searchUserReset();
|
||||||
|
this.props.getQRCodeDetailReset();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{cancelable: false}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
async requestCameraPermission() {
|
async requestCameraPermission() {
|
||||||
try {
|
try {
|
||||||
const granted = await PermissionsAndroid.request(
|
const granted = await PermissionsAndroid.request(
|
||||||
|
@ -1119,6 +1168,14 @@ class Home extends BaseScreen {
|
||||||
return (<ActionButton
|
return (<ActionButton
|
||||||
buttonColor={theme.accent}
|
buttonColor={theme.accent}
|
||||||
>
|
>
|
||||||
|
<ActionButton.Item buttonColor='#3498db' title={I18n.t("SEARCH")}
|
||||||
|
onPress={() => {
|
||||||
|
this.setState({dialogSearchUser: true});
|
||||||
|
}}
|
||||||
|
size={48}
|
||||||
|
>
|
||||||
|
<Icon name="search" style={styles.actionButtonIcon}/>
|
||||||
|
</ActionButton.Item>
|
||||||
<ActionButton.Item buttonColor='#3498db' title={I18n.t("MY_GROUP")} onPress={() => this.showMyMembers()}
|
<ActionButton.Item buttonColor='#3498db' title={I18n.t("MY_GROUP")} onPress={() => this.showMyMembers()}
|
||||||
size={48}
|
size={48}
|
||||||
>
|
>
|
||||||
|
@ -1155,6 +1212,14 @@ class Home extends BaseScreen {
|
||||||
>
|
>
|
||||||
<Icon name="filter-list" style={styles.actionButtonIcon}/>
|
<Icon name="filter-list" style={styles.actionButtonIcon}/>
|
||||||
</ActionButton.Item>
|
</ActionButton.Item>
|
||||||
|
<ActionButton.Item buttonColor='#3498db' title={I18n.t("SEARCH")}
|
||||||
|
onPress={() => {
|
||||||
|
this.setState({dialogSearchUser: true});
|
||||||
|
}}
|
||||||
|
size={48}
|
||||||
|
>
|
||||||
|
<Icon name="search" style={styles.actionButtonIcon}/>
|
||||||
|
</ActionButton.Item>
|
||||||
<ActionButton.Item buttonColor='#3498db' title={I18n.t("REPOSITIONNING")}
|
<ActionButton.Item buttonColor='#3498db' title={I18n.t("REPOSITIONNING")}
|
||||||
onPress={() => this.refocusMap(false)}
|
onPress={() => this.refocusMap(false)}
|
||||||
size={48}
|
size={48}
|
||||||
|
@ -1319,7 +1384,13 @@ class Home extends BaseScreen {
|
||||||
dialogNetworkVisible: false,
|
dialogNetworkVisible: false,
|
||||||
myPositionMarkerText: I18n.t("YOUR_THERE"),
|
myPositionMarkerText: I18n.t("YOUR_THERE"),
|
||||||
isSaveOneSignalOK: false,
|
isSaveOneSignalOK: false,
|
||||||
publicite: null
|
publicite: null,
|
||||||
|
userName: '',
|
||||||
|
isNumeroAssureSearch: false,
|
||||||
|
isPhoneAssureSearch: false,
|
||||||
|
showQRCodeScanner: false,
|
||||||
|
displayDialogResultSearch: false,
|
||||||
|
dialogSearchUser: false
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1726,6 +1797,9 @@ class Home extends BaseScreen {
|
||||||
{this.makeDialogLoader()}
|
{this.makeDialogLoader()}
|
||||||
{this.makeDistanceDialog()}
|
{this.makeDistanceDialog()}
|
||||||
{this.makeNetworkChangeDialog()}
|
{this.makeNetworkChangeDialog()}
|
||||||
|
{this.renderSearchUser()}
|
||||||
|
{this.state.showQRCodeScanner && this.renderDialogQRCodeScanner()}
|
||||||
|
{this.state.displayDialogResultSearch && this.renderDialogResultSearchUser()}
|
||||||
<SnackBar visible={this.state.snack_visible}
|
<SnackBar visible={this.state.snack_visible}
|
||||||
textMessage={this.state.snack_text_message}
|
textMessage={this.state.snack_text_message}
|
||||||
autoHidingTime={5000}
|
autoHidingTime={5000}
|
||||||
|
@ -1992,6 +2066,204 @@ class Home extends BaseScreen {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
renderDialogQRCodeScanner() {
|
||||||
|
return (
|
||||||
|
<Dialog.Container contentStyle={{width: responsiveWidth(80)}} useNativeDriver={true}
|
||||||
|
visible={this.state.showQRCodeScanner}>
|
||||||
|
|
||||||
|
<Dialog.Title>{I18n.t('SCAN')}</Dialog.Title>
|
||||||
|
|
||||||
|
<ScrollView style={[styles.blockView, {borderBottomColor: Color.borderColor, maxHeight: 300}]}>
|
||||||
|
<Text>
|
||||||
|
{I18n.t('BRING_YOUR_CAMERA_CLOSER_TO_SCAN_QR_CODE')}
|
||||||
|
</Text>
|
||||||
|
<QRCodeScanner
|
||||||
|
onRead={(result) => {
|
||||||
|
this.setState({
|
||||||
|
showQRCodeScanner: false
|
||||||
|
});
|
||||||
|
this.props.getQRCodeDetailAction(result.data);
|
||||||
|
//fetchGetUserByIdQRCode(result.data);
|
||||||
|
}}
|
||||||
|
flashMode={RNCamera.Constants.FlashMode.off}
|
||||||
|
/>
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
|
<Dialog.Button bold={true} label={I18n.t('CLOSE')} onPress={() => {
|
||||||
|
this.setState({
|
||||||
|
showQRCodeScanner: false
|
||||||
|
});
|
||||||
|
}}/>
|
||||||
|
</Dialog.Container>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
renderSearchUser() {
|
||||||
|
return (
|
||||||
|
<MaterialDialog
|
||||||
|
title={I18n.t("SEARCH")}
|
||||||
|
visible={this.state.dialogSearchUser}
|
||||||
|
onCancel={() => this.setState({dialogSearchUser: false})}
|
||||||
|
onOk={result => {
|
||||||
|
if (this.state.isPhoneAssureSearch) {
|
||||||
|
this.props.searchUserAction({
|
||||||
|
dial_code: this.state.indicatif,
|
||||||
|
phone: this.state.userName,
|
||||||
|
|
||||||
|
}, true);
|
||||||
|
} else {
|
||||||
|
this.props.searchUserAction({
|
||||||
|
dial_code: this.state.indicatif,
|
||||||
|
name: this.state.userName,
|
||||||
|
}, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.setState({dialogSearchUser: false});
|
||||||
|
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<View>
|
||||||
|
<TextInput
|
||||||
|
style={{marginTop: 10, height: 46, borderRadius: 5, borderWidth: 1, borderColor: "#ccc"}}
|
||||||
|
placeholder={this.state.isPhoneAssureSearch ? I18n.t('PHONE') : I18n.t('NAME')}
|
||||||
|
value={this.state.userName}
|
||||||
|
keyboardType={this.state.isPhoneAssureSearch ? 'numeric' : 'default'}
|
||||||
|
onChangeText={(userName) => {
|
||||||
|
this.setState({userName});
|
||||||
|
}}
|
||||||
|
icon={
|
||||||
|
<FontAwesome
|
||||||
|
style={{zIndex: 10}}
|
||||||
|
name={this.state.isPhoneAssureSearch ? 'phone' : 'user'}
|
||||||
|
size={20}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<View style={{
|
||||||
|
flexDirection: 'row',
|
||||||
|
position: 'absolute',
|
||||||
|
top: 22,
|
||||||
|
right: 50,
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
width: 50
|
||||||
|
}}>
|
||||||
|
<FontAwesomeIcon
|
||||||
|
style={{paddingRight: 5}}
|
||||||
|
name='phone'
|
||||||
|
size={20}
|
||||||
|
color={Color.primaryColor}
|
||||||
|
onPress={() => {
|
||||||
|
this.setState({
|
||||||
|
isNumeroAssureSearch: false,
|
||||||
|
isPhoneAssureSearch: true
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<FontAwesomeIcon
|
||||||
|
style={{paddingRight: 5}}
|
||||||
|
name='user'
|
||||||
|
size={20}
|
||||||
|
color={Color.primaryColor}
|
||||||
|
onPress={() => {
|
||||||
|
this.setState({
|
||||||
|
isNumeroAssureSearch: false,
|
||||||
|
isPhoneAssureSearch: false
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<FontAwesomeIcon
|
||||||
|
style={{paddingRight: 5}}
|
||||||
|
name="qrcode"
|
||||||
|
size={20}
|
||||||
|
color={Color.primaryColor}
|
||||||
|
onPress={() => {
|
||||||
|
this.setState({
|
||||||
|
showQRCodeScanner: true
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
{/* <Fumi iconClass={FontAwesomeIcon}
|
||||||
|
label={I18n.t('NAME')}
|
||||||
|
iconColor={'#f95a25'}
|
||||||
|
iconSize={20}
|
||||||
|
iconName={"user"}
|
||||||
|
value={this.state.userName}
|
||||||
|
onChangeText={(userName) => {
|
||||||
|
this.setState({userName});
|
||||||
|
}}
|
||||||
|
style={styles.input}
|
||||||
|
>
|
||||||
|
</Fumi>*/}
|
||||||
|
|
||||||
|
</MaterialDialog>)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
renderDialogResultSearchUser() {
|
||||||
|
|
||||||
|
const {resultSearchUserByName, errorGetAvisImposition} = this.props;
|
||||||
|
console.log("resultGetAvisImposition", resultSearchUserByName);
|
||||||
|
return (
|
||||||
|
<Dialog.Container contentStyle={{width: responsiveWidth(80)}} useNativeDriver={true}
|
||||||
|
visible={this.state.displayDialogResultSearch}>
|
||||||
|
|
||||||
|
<Dialog.Title>{I18n.t('USAGER_SEARCH')}</Dialog.Title>
|
||||||
|
|
||||||
|
<ScrollView style={[styles.blockView, {borderBottomColor: Color.borderColor, maxHeight: 300}]}>
|
||||||
|
{
|
||||||
|
Array.isArray(resultSearchUserByName.response) && (resultSearchUserByName.response.length) > 0 ?
|
||||||
|
|
||||||
|
resultSearchUserByName.response.map((item) => (
|
||||||
|
<TouchableOpacity onPress={() => {
|
||||||
|
this.props.searchUserReset();
|
||||||
|
this.setState({
|
||||||
|
userName: '',
|
||||||
|
displayDialogResultSearch: false
|
||||||
|
});
|
||||||
|
console.log("Markers", this.state.markers);
|
||||||
|
|
||||||
|
if (this.state.markers.filter((marker) => marker.phone === item.phone).length > 0)
|
||||||
|
this.userChangeMarker(item);
|
||||||
|
else {
|
||||||
|
this.setState({
|
||||||
|
markers: [...this.state.markers, item],
|
||||||
|
}, () => {
|
||||||
|
this.userChangeMarker(item);
|
||||||
|
});
|
||||||
|
this.setState({currentNetworkSize: this.state.currentNetworkSize + 1})
|
||||||
|
}
|
||||||
|
}} style={[styles.paymentItem]}>
|
||||||
|
|
||||||
|
<View style={{flexDirection: 'column'}}>
|
||||||
|
<Text style={styles.title}>{item.lastname}</Text>
|
||||||
|
<Text style={styles.description}>
|
||||||
|
{`${item.phone} | ${item.email} | ${item.adresse}`}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
</TouchableOpacity>
|
||||||
|
)) :
|
||||||
|
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
|
||||||
|
<Text style={Typography.body1}>{I18n.t('NO_USAGER_CORRESPONDING_TO_SEARCH')}</Text>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
}
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
|
<Dialog.Button bold={true} label={I18n.t('OK')} onPress={() => {
|
||||||
|
this.props.searchUserReset();
|
||||||
|
this.setState({
|
||||||
|
displayDialogResultSearch: false
|
||||||
|
});
|
||||||
|
}}/>
|
||||||
|
</Dialog.Container>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
renderRow = (row) => (
|
renderRow = (row) => (
|
||||||
<TouchableOpacity key={row} onPress={() => this.onRowPress(row)}>
|
<TouchableOpacity key={row} onPress={() => this.onRowPress(row)}>
|
||||||
<View style={styles.rowContainer}>
|
<View style={styles.rowContainer}>
|
||||||
|
@ -2613,13 +2885,28 @@ const mapStateToProps = state => ({
|
||||||
loadingSaveOneSignal: state.saveOnesignalReducer.loading,
|
loadingSaveOneSignal: state.saveOnesignalReducer.loading,
|
||||||
resultSaveOneSignal: state.saveOnesignalReducer.result,
|
resultSaveOneSignal: state.saveOnesignalReducer.result,
|
||||||
errorSaveOneSignal: state.saveOnesignalReducer.error,
|
errorSaveOneSignal: state.saveOnesignalReducer.error,
|
||||||
|
|
||||||
|
loadingSearchUserByName: state.searchUserReducer.loading,
|
||||||
|
resultSearchUserByName: state.searchUserReducer.result,
|
||||||
|
errorSearchUserByName: state.searchUserReducer.error,
|
||||||
|
|
||||||
|
|
||||||
|
loadingGetQRCodeDetail: state.getQRCodeDetailReducer.loading,
|
||||||
|
resultGetQRCodeDetail: state.getQRCodeDetailReducer.result,
|
||||||
|
errorGetQRCodeDetail: state.getQRCodeDetailReducer.error,
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapDispatchToProps = dispatch => bindActionCreators({
|
const mapDispatchToProps = dispatch => bindActionCreators({
|
||||||
getAuthApiKey,
|
getAuthApiKey,
|
||||||
getWalletActivated,
|
getWalletActivated,
|
||||||
saveOnesignalIdsAction,
|
saveOnesignalIdsAction,
|
||||||
saveOnesignalIdsReset
|
saveOnesignalIdsReset,
|
||||||
|
|
||||||
|
searchUserAction,
|
||||||
|
searchUserReset,
|
||||||
|
|
||||||
|
getQRCodeDetailReset,
|
||||||
|
getQRCodeDetailAction
|
||||||
}, dispatch);
|
}, dispatch);
|
||||||
|
|
||||||
export default connect(mapStateToProps, mapDispatchToProps)(Home);
|
export default connect(mapStateToProps, mapDispatchToProps)(Home);
|
||||||
|
|
|
@ -434,7 +434,7 @@ const ExecuterPrescriptionScreen = ({
|
||||||
} else {
|
} else {
|
||||||
setConsultation({
|
setConsultation({
|
||||||
...consultation,
|
...consultation,
|
||||||
prestations: consultation.prestations.map(presta => {
|
prescriptions: consultation.prescriptions.map(presta => {
|
||||||
return elementToSetPrice.id === presta.id ? {
|
return elementToSetPrice.id === presta.id ? {
|
||||||
...presta,
|
...presta,
|
||||||
unit_price: consultationClone.exams.filter(prestation => prestation.id === elementToSetPrice.id)[0].unit_price
|
unit_price: consultationClone.exams.filter(prestation => prestation.id === elementToSetPrice.id)[0].unit_price
|
||||||
|
@ -627,7 +627,7 @@ const ExecuterPrescriptionScreen = ({
|
||||||
prescriptions: [
|
prescriptions: [
|
||||||
{
|
{
|
||||||
unit_price: values.price,
|
unit_price: values.price,
|
||||||
quantity: values.examen_quantity
|
quantity: consultation.prescriptions.filter(prescription => elementToSetPrice.id === prescription.id)[0].quantity
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
|
@ -84,7 +84,7 @@ import Modal from "react-native-modal";
|
||||||
import QRCodeScanner from "react-native-qrcode-scanner";
|
import QRCodeScanner from "react-native-qrcode-scanner";
|
||||||
import {RNCamera} from "react-native-camera";
|
import {RNCamera} from "react-native-camera";
|
||||||
import * as Utils from "../../../utils/UtilsFunction";
|
import * as Utils from "../../../utils/UtilsFunction";
|
||||||
import {cutString, uppercaseFirstLetter} from "../../../utils/UtilsFunction";
|
import {cutString, cutStringWithoutDot, uppercaseFirstLetter} from "../../../utils/UtilsFunction";
|
||||||
import {store} from "../../../redux/store";
|
import {store} from "../../../redux/store";
|
||||||
import {Typography} from "../../../config/typography";
|
import {Typography} from "../../../config/typography";
|
||||||
import DateTimePicker from "@react-native-community/datetimepicker";
|
import DateTimePicker from "@react-native-community/datetimepicker";
|
||||||
|
@ -623,8 +623,8 @@ const ModifierFeuilleSoinScreen = ({
|
||||||
|
|
||||||
const ModifyNewExamen = Yup.object().shape({
|
const ModifyNewExamen = Yup.object().shape({
|
||||||
examen_name: Yup.string().required(I18n.t('THIS_FIELD_IS_REQUIRED')),
|
examen_name: Yup.string().required(I18n.t('THIS_FIELD_IS_REQUIRED')),
|
||||||
examen_quantite: Yup.number(),
|
examen_quantite: Yup.mixed(),
|
||||||
amount: Yup.number().required(I18n.t('THIS_FIELD_IS_REQUIRED'))
|
amount: Yup.mixed(),
|
||||||
});
|
});
|
||||||
|
|
||||||
const AddNewMedicament = Yup.object().shape({
|
const AddNewMedicament = Yup.object().shape({
|
||||||
|
@ -884,7 +884,7 @@ const ModifierFeuilleSoinScreen = ({
|
||||||
care_condition: consultation._care_condition
|
care_condition: consultation._care_condition
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
editable={false}
|
editable={values.code_acte !== '' ? values.code_acte.billing_type === 'FREE' : true}
|
||||||
onBlur={handleBlur('amount_prestation')}
|
onBlur={handleBlur('amount_prestation')}
|
||||||
success={touched.amount_prestation && !errors.amount_prestation}
|
success={touched.amount_prestation && !errors.amount_prestation}
|
||||||
touched={touched.amount_prestation}
|
touched={touched.amount_prestation}
|
||||||
|
@ -1690,6 +1690,7 @@ const ModifierFeuilleSoinScreen = ({
|
||||||
isSubmitting,
|
isSubmitting,
|
||||||
}) => (
|
}) => (
|
||||||
<ScrollView style={{flex: 1}}>
|
<ScrollView style={{flex: 1}}>
|
||||||
|
{console.log("Errors", errors)}
|
||||||
<View
|
<View
|
||||||
style={[styles.containModal, {backgroundColor: Color.containerBackgroundColor}]}>
|
style={[styles.containModal, {backgroundColor: Color.containerBackgroundColor}]}>
|
||||||
<Modal
|
<Modal
|
||||||
|
@ -2037,7 +2038,7 @@ const ModifierFeuilleSoinScreen = ({
|
||||||
]}
|
]}
|
||||||
key={item.id}>
|
key={item.id}>
|
||||||
<Text body2 semibold numberOfLines={2}>
|
<Text body2 semibold numberOfLines={2}>
|
||||||
{`${item.description} ${item.unit_price ? ' - ' + item.unit_price : ''} \n ${item.act.name}`}
|
{`${item.description} ${item.unit_price ? ' - ' + item.unit_price : ''} \n ${cutStringWithoutDot(item.act.name, 50)}`}
|
||||||
</Text>
|
</Text>
|
||||||
<View style={styles.iconRight}>
|
<View style={styles.iconRight}>
|
||||||
<TouchableOpacity onPress={() => {
|
<TouchableOpacity onPress={() => {
|
||||||
|
|
|
@ -653,7 +653,7 @@
|
||||||
"CLASSE_PRESTATAIRE": "Classe de prestataire",
|
"CLASSE_PRESTATAIRE": "Classe de prestataire",
|
||||||
"FRAIS_DEPLACEMENT": "Frais de déplacement",
|
"FRAIS_DEPLACEMENT": "Frais de déplacement",
|
||||||
"AJOUTER_MEDICAMENT": "Ajouter médicament/appareil",
|
"AJOUTER_MEDICAMENT": "Ajouter médicament/appareil",
|
||||||
"AJOUTER_EXAMEN": "Ajouter examen",
|
"AJOUTER_EXAMEN": "Ajouter autre acte ou examen",
|
||||||
"NAME": "Nom",
|
"NAME": "Nom",
|
||||||
"POSOLOGIE": "Posologie",
|
"POSOLOGIE": "Posologie",
|
||||||
"QUANTITE": "Quantité",
|
"QUANTITE": "Quantité",
|
||||||
|
@ -731,5 +731,11 @@
|
||||||
"AMOUNT_FREE": "Montant libre",
|
"AMOUNT_FREE": "Montant libre",
|
||||||
"DESCRIPTION": "Description",
|
"DESCRIPTION": "Description",
|
||||||
"EXECUTION": "Execution",
|
"EXECUTION": "Execution",
|
||||||
"UNIT_QUANTITE": "Qté unitaire"
|
"UNIT_QUANTITE": "Qté unitaire",
|
||||||
|
"NO_USAGER_CORRESPONDING_TO_SEARCH": "Aucun usager ne correspond à votre recherche",
|
||||||
|
"USAGER_SEARCH": "Recherche d'un usager",
|
||||||
|
"BY_NAME": "Par nom",
|
||||||
|
"BY_QR_CODE": "Par QR Code",
|
||||||
|
"SCAN": "Scanner",
|
||||||
|
"BRING_YOUR_CAMERA_CLOSER_TO_SCAN_QR_CODE": "Approchez votre caméra du QR Code afin de le scanner"
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,6 +82,11 @@ export const getIlinkBankListUrl = testBaseUrl + '/walletService/wallets/users/b
|
||||||
export const linkBankAccountUrl = testBaseUrl + '/walletService/wallets/users/link_bank_account';
|
export const linkBankAccountUrl = testBaseUrl + '/walletService/wallets/users/link_bank_account';
|
||||||
export const payBillUrl = testBaseUrl + '/walletService/transactions/ilink';
|
export const payBillUrl = testBaseUrl + '/walletService/transactions/ilink';
|
||||||
|
|
||||||
|
export const searchUserUrl = testBaseUrl + '/walletService/search/users';
|
||||||
|
export const searchUserHomeUrl = testBaseUrl + '/walletService/agents';
|
||||||
|
export const getQRCodeDetail = testBaseUrl + '/walletService/qrcode/read';
|
||||||
|
|
||||||
|
|
||||||
export const facturerSoinUrl = testBaseUrl + '/nanoSanteService/generate-invoice';
|
export const facturerSoinUrl = testBaseUrl + '/nanoSanteService/generate-invoice';
|
||||||
export const invoiceUrl = testBaseUrl + '/nanoSanteService/invoices';
|
export const invoiceUrl = testBaseUrl + '/nanoSanteService/invoices';
|
||||||
export const getInsuranceListUrl = testBaseUrl + '/nanoSanteService/insurances';
|
export const getInsuranceListUrl = testBaseUrl + '/nanoSanteService/insurances';
|
||||||
|
|
|
@ -2,9 +2,12 @@ import {
|
||||||
commissionAmount,
|
commissionAmount,
|
||||||
getIlinkBankListUrl,
|
getIlinkBankListUrl,
|
||||||
getOperatorListUrl,
|
getOperatorListUrl,
|
||||||
|
getQRCodeDetail,
|
||||||
linkBankAccountUrl,
|
linkBankAccountUrl,
|
||||||
linkCardUrl,
|
linkCardUrl,
|
||||||
payBillUrl,
|
payBillUrl,
|
||||||
|
searchUserHomeUrl,
|
||||||
|
searchUserUrl,
|
||||||
walletActionUrl,
|
walletActionUrl,
|
||||||
walletDetailUrl,
|
walletDetailUrl,
|
||||||
walletUserSimpleActionUrl
|
walletUserSimpleActionUrl
|
||||||
|
@ -18,6 +21,10 @@ import {
|
||||||
fetchGetListOperatorPending,
|
fetchGetListOperatorPending,
|
||||||
fetchGetListOperatorReset,
|
fetchGetListOperatorReset,
|
||||||
fetchGetListOperatorSuccess,
|
fetchGetListOperatorSuccess,
|
||||||
|
fetchGetQRCodeDetailError,
|
||||||
|
fetchGetQRCodeDetailPending,
|
||||||
|
fetchGetQRCodeDetailReset,
|
||||||
|
fetchGetQRCodeDetailSuccess,
|
||||||
fetchLinkCardError,
|
fetchLinkCardError,
|
||||||
fetchLinkCardPending,
|
fetchLinkCardPending,
|
||||||
fetchLinkCardReset,
|
fetchLinkCardReset,
|
||||||
|
@ -30,6 +37,10 @@ import {
|
||||||
fetchReattachAccountPending,
|
fetchReattachAccountPending,
|
||||||
fetchReattachAccountReset,
|
fetchReattachAccountReset,
|
||||||
fetchReattachAccountSuccess,
|
fetchReattachAccountSuccess,
|
||||||
|
fetchSearchUserError,
|
||||||
|
fetchSearchUserPending,
|
||||||
|
fetchSearchUserReset,
|
||||||
|
fetchSearchUserSuccess,
|
||||||
fetchWalleGetCommissionError,
|
fetchWalleGetCommissionError,
|
||||||
fetchWalletGetCommissionPending,
|
fetchWalletGetCommissionPending,
|
||||||
fetchWalletGetCommissionSuccess,
|
fetchWalletGetCommissionSuccess,
|
||||||
|
@ -352,3 +363,76 @@ export const reattachAccountReset = () => {
|
||||||
dispatch(fetchReattachAccountReset());
|
dispatch(fetchReattachAccountReset());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const searchUserAction = (data, searchFromMap = false) => {
|
||||||
|
|
||||||
|
const auth = store.getState().authKeyReducer;
|
||||||
|
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
|
||||||
|
|
||||||
|
return dispatch => {
|
||||||
|
dispatch(fetchSearchUserPending());
|
||||||
|
|
||||||
|
axios({
|
||||||
|
url: searchFromMap ? searchUserHomeUrl : `${searchUserUrl}?name=${data}`,
|
||||||
|
method: searchFromMap ? 'POST' : 'GET',
|
||||||
|
data,
|
||||||
|
headers: {
|
||||||
|
'Authorization': authKey,
|
||||||
|
'X-Localization': I18n.currentLocale()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then(response => {
|
||||||
|
console.log(response);
|
||||||
|
dispatch(fetchSearchUserSuccess(response));
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
if (error.response)
|
||||||
|
dispatch(fetchSearchUserError(error.response));
|
||||||
|
else if (error.request)
|
||||||
|
dispatch(fetchSearchUserError(error.request));
|
||||||
|
else
|
||||||
|
dispatch(fetchSearchUserError(error.message));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export const searchUserReset = () => {
|
||||||
|
return dispatch => {
|
||||||
|
dispatch(fetchSearchUserReset());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getQRCodeDetailAction = (id) => {
|
||||||
|
|
||||||
|
const auth = store.getState().authKeyReducer;
|
||||||
|
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
|
||||||
|
|
||||||
|
return dispatch => {
|
||||||
|
dispatch(fetchGetQRCodeDetailPending());
|
||||||
|
|
||||||
|
axios({
|
||||||
|
url: `${getQRCodeDetail}/${id}`,
|
||||||
|
method: 'GET',
|
||||||
|
headers: {
|
||||||
|
'Authorization': authKey,
|
||||||
|
'X-Localization': I18n.currentLocale()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then(response => {
|
||||||
|
console.log(response);
|
||||||
|
dispatch(fetchGetQRCodeDetailSuccess(response));
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
if (error.response)
|
||||||
|
dispatch(fetchGetQRCodeDetailError(error.response));
|
||||||
|
else if (error.request)
|
||||||
|
dispatch(fetchGetQRCodeDetailError(error.request));
|
||||||
|
else
|
||||||
|
dispatch(fetchGetQRCodeDetailError(error.message));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export const getQRCodeDetailReset = () => {
|
||||||
|
return dispatch => {
|
||||||
|
dispatch(fetchGetQRCodeDetailReset());
|
||||||
|
}
|
||||||
|
};
|
Loading…
Reference in New Issue