correction bugs ok
This commit is contained in:
parent
4193ce4965
commit
e9f8c6bbcc
2
App.js
2
App.js
|
@ -96,6 +96,7 @@ import HistoriqueNanoSanteUserScreen from "./screens/wallet/user/HistoriqueNanoS
|
||||||
import DemandeAutorisationSoinScreen from "./screens/wallet/user/DemandeAutorisationSoinScreen";
|
import DemandeAutorisationSoinScreen from "./screens/wallet/user/DemandeAutorisationSoinScreen";
|
||||||
import DeleteBeneficiaryScreen from "./screens/wallet/user/DeleteBeneficiaryScreen";
|
import DeleteBeneficiaryScreen from "./screens/wallet/user/DeleteBeneficiaryScreen";
|
||||||
import StopSubscriptionScreen from "./screens/wallet/user/StopSubscriptionScreen";
|
import StopSubscriptionScreen from "./screens/wallet/user/StopSubscriptionScreen";
|
||||||
|
import RenewAssuranceScreen from "./screens/wallet/user/RenewAssuranceScreen";
|
||||||
|
|
||||||
|
|
||||||
const instructions = Platform.select({
|
const instructions = Platform.select({
|
||||||
|
@ -150,6 +151,7 @@ const AppStack = createDrawerNavigator({
|
||||||
validateConsultationDetailScreen: ValidateConsultationDetailScreen,
|
validateConsultationDetailScreen: ValidateConsultationDetailScreen,
|
||||||
activateBuySubscriptionScreen: ActivateBuySubscriptionScreen,
|
activateBuySubscriptionScreen: ActivateBuySubscriptionScreen,
|
||||||
stopSubscriptionScreen: StopSubscriptionScreen,
|
stopSubscriptionScreen: StopSubscriptionScreen,
|
||||||
|
renewAssuranceScreen: RenewAssuranceScreen,
|
||||||
historiqueNanoSanteUserScreen: HistoriqueNanoSanteUserScreen,
|
historiqueNanoSanteUserScreen: HistoriqueNanoSanteUserScreen,
|
||||||
deleteBeneficiaryScreen: DeleteBeneficiaryScreen,
|
deleteBeneficiaryScreen: DeleteBeneficiaryScreen,
|
||||||
retraitWalletVersCashUser: RetraitWalletVersCashUser,
|
retraitWalletVersCashUser: RetraitWalletVersCashUser,
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -572,7 +572,7 @@
|
||||||
"MANAGE_ASSURANCE": "Gérer son assurance",
|
"MANAGE_ASSURANCE": "Gérer son assurance",
|
||||||
"MANAGE_HEALTH": "Gérer ses soins",
|
"MANAGE_HEALTH": "Gérer ses soins",
|
||||||
"DEMAND_AUTORIZATION_HEALTH": "Demande autorisation soin",
|
"DEMAND_AUTORIZATION_HEALTH": "Demande autorisation soin",
|
||||||
"HISTORIC_HEALTH": "Historique souscriptions et soins",
|
"HISTORIC_HEALTH": "Historique",
|
||||||
"VALID_HEALTH": "Valider un soin ",
|
"VALID_HEALTH": "Valider un soin ",
|
||||||
"ACTIVATE_INSSURANCE": "Activer son assurance",
|
"ACTIVATE_INSSURANCE": "Activer son assurance",
|
||||||
"AMOUNT_PER_DURATION": "Montant par durée",
|
"AMOUNT_PER_DURATION": "Montant par durée",
|
||||||
|
|
|
@ -242,6 +242,17 @@ export const fetchStopSubscription = (id, data) => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const fetchRenewSubscription = (id, data) => {
|
||||||
|
return ApiAction({
|
||||||
|
url: `${getInsuranceListUrl}/${id}/renew`,
|
||||||
|
data,
|
||||||
|
method: 'PUT',
|
||||||
|
onLoading: fetchStopSubscriptionPending,
|
||||||
|
onSuccess: fetchStopSubscriptionSuccess,
|
||||||
|
onError: fetchStopSubscriptionError,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
/************************************************************/
|
/************************************************************/
|
||||||
export const fetchAddBeneficiaryToSubscriptionPending = () => ({
|
export const fetchAddBeneficiaryToSubscriptionPending = () => ({
|
||||||
type: InsuranceActions.ADD_BENEFICIARY_TO_SUBSCRIPTION_PENDING,
|
type: InsuranceActions.ADD_BENEFICIARY_TO_SUBSCRIPTION_PENDING,
|
||||||
|
@ -529,7 +540,7 @@ export const fetchGetConsultationError = (error: any) => ({
|
||||||
export const fetchGetConsultation = (user_id, state = 'UNTREATED', typeParam = 'CONSULTATION', otherParam = '') => {
|
export const fetchGetConsultation = (user_id, state = 'UNTREATED', typeParam = 'CONSULTATION', otherParam = '') => {
|
||||||
console.log("user_id", user_id);
|
console.log("user_id", user_id);
|
||||||
return ApiAction({
|
return ApiAction({
|
||||||
url: `${consultationUrl}?user_id=${user_id}&state=${state}${otherParam}`,
|
url: `${consultationUrl}?user_id=${user_id}&state=${state}&type=${typeParam}${otherParam}`,
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
onLoading: fetchGetConsultationPending,
|
onLoading: fetchGetConsultationPending,
|
||||||
onSuccess: fetchGetConsultationSuccess,
|
onSuccess: fetchGetConsultationSuccess,
|
||||||
|
|
|
@ -274,7 +274,7 @@ export default class OptionsMenu extends Component {
|
||||||
|| item === 'epargnerArgentUser' || item === 'askNanoCredit' || item === 'casserEpargneUser' || item === 'envoieWalletToBankAgent' || item === 'reattachAccountUser' || item === 'insuranceSubscriptionScreen'
|
|| item === 'epargnerArgentUser' || item === 'askNanoCredit' || item === 'casserEpargneUser' || item === 'envoieWalletToBankAgent' || item === 'reattachAccountUser' || item === 'insuranceSubscriptionScreen'
|
||||||
|| item === 'addBeneficiaryScreen' || item === 'activateBuySubscriptionScreen' || item === 'saisirFeuilleSoinScreen' || item === 'validateConsultationScreen' || item === 'validateConsultationDetailScreen'
|
|| item === 'addBeneficiaryScreen' || item === 'activateBuySubscriptionScreen' || item === 'saisirFeuilleSoinScreen' || item === 'validateConsultationScreen' || item === 'validateConsultationDetailScreen'
|
||||||
|| item === 'executerPrescriptionScreen' || item === 'modifierFeuilleSoinScreen' || item === 'modifierExecutionPrescriptionScreen' || item === 'historiqueNanoSanteUserScreen'
|
|| item === 'executerPrescriptionScreen' || item === 'modifierFeuilleSoinScreen' || item === 'modifierExecutionPrescriptionScreen' || item === 'historiqueNanoSanteUserScreen'
|
||||||
|| item === 'demandeAutorisationSoinScreen' || item === 'deleteBeneficiaryScreen' || item === 'StopSubscriptionScreen' || item === 'stopSubscriptionScreen') {
|
|| item === 'demandeAutorisationSoinScreen' || item === 'deleteBeneficiaryScreen' || item === 'StopSubscriptionScreen' || item === 'stopSubscriptionScreen' || item === 'renewAssuranceScreen') {
|
||||||
return null
|
return null
|
||||||
} else {
|
} else {
|
||||||
const color = this.state.currentId === item.id ? theme.accent : "grey"
|
const color = this.state.currentId === item.id ? theme.accent : "grey"
|
||||||
|
|
|
@ -28,6 +28,7 @@ import {ScreenComponent} from "../../../components/ScreenComponent";
|
||||||
import Button from "../../../components/Button";
|
import Button from "../../../components/Button";
|
||||||
import {responsiveWidth} from "react-native-responsive-dimensions";
|
import {responsiveWidth} from "react-native-responsive-dimensions";
|
||||||
import {
|
import {
|
||||||
|
fetchAcceptRejectConsultationReset,
|
||||||
fetchActivePaySubscription,
|
fetchActivePaySubscription,
|
||||||
fetchCreateConsultation,
|
fetchCreateConsultation,
|
||||||
fetchCreateConsultationReset,
|
fetchCreateConsultationReset,
|
||||||
|
@ -357,12 +358,24 @@ const ExecuterPrescriptionScreen = ({
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getUserByNameOrNumber.error) {
|
if (getUserByNameOrNumber.error) {
|
||||||
dropDownAlertRef.alertWithType(
|
Alert.alert(
|
||||||
|
I18n.t("ERROR_LABLE"),
|
||||||
|
Utils.getErrorMsg(getUserByNameOrNumber),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
dispatch(fetchGetUserByNameOrNumberReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
);
|
||||||
|
/* dropDownAlertRef.alertWithType(
|
||||||
'error',
|
'error',
|
||||||
I18n.t('ERROR_LABEL'),
|
I18n.t('ERROR_LABEL'),
|
||||||
Utils.getErrorMsg(getUserByNameOrNumber),
|
Utils.getErrorMsg(getUserByNameOrNumber),
|
||||||
);
|
);
|
||||||
dispatch(fetchGetUserByNameOrNumberReset());
|
dispatch(fetchGetUserByNameOrNumberReset());*/
|
||||||
}
|
}
|
||||||
}, [getUserByNameOrNumber]);
|
}, [getUserByNameOrNumber]);
|
||||||
|
|
||||||
|
@ -372,12 +385,24 @@ const ExecuterPrescriptionScreen = ({
|
||||||
setModalConsultation(true);
|
setModalConsultation(true);
|
||||||
|
|
||||||
if (getConsultation.error) {
|
if (getConsultation.error) {
|
||||||
dropDownAlertRef.alertWithType(
|
Alert.alert(
|
||||||
|
I18n.t("ERROR_LABLE"),
|
||||||
|
Utils.getErrorMsg(getConsultation),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
dispatch(fetchGetConsultationReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
);
|
||||||
|
/* dropDownAlertRef.alertWithType(
|
||||||
'error',
|
'error',
|
||||||
I18n.t('ERROR_LABEL'),
|
I18n.t('ERROR_LABEL'),
|
||||||
Utils.getErrorMsg(getConsultation),
|
Utils.getErrorMsg(getConsultation),
|
||||||
);
|
);
|
||||||
dispatch(fetchGetConsultationReset());
|
dispatch(fetchGetConsultationReset());*/
|
||||||
}
|
}
|
||||||
}, [getConsultation]);
|
}, [getConsultation]);
|
||||||
|
|
||||||
|
@ -400,12 +425,24 @@ const ExecuterPrescriptionScreen = ({
|
||||||
}
|
}
|
||||||
|
|
||||||
if (executionPrescription.error) {
|
if (executionPrescription.error) {
|
||||||
dropDownAlertRef.alertWithType(
|
Alert.alert(
|
||||||
|
I18n.t("ERROR_LABLE"),
|
||||||
|
Utils.getErrorMsg(executionPrescription),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
dispatch(fetchExecutionPrescriptionReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
);
|
||||||
|
/* dropDownAlertRef.alertWithType(
|
||||||
'error',
|
'error',
|
||||||
I18n.t('ERROR_LABEL'),
|
I18n.t('ERROR_LABEL'),
|
||||||
Utils.getErrorMsg(executionPrescription),
|
Utils.getErrorMsg(executionPrescription),
|
||||||
);
|
);
|
||||||
dispatch(fetchExecutionPrescriptionReset());
|
dispatch(fetchExecutionPrescriptionReset());*/
|
||||||
}
|
}
|
||||||
}, [executionPrescription]);
|
}, [executionPrescription]);
|
||||||
|
|
||||||
|
@ -680,7 +717,7 @@ const ExecuterPrescriptionScreen = ({
|
||||||
}
|
}
|
||||||
}}>
|
}}>
|
||||||
<Text body2 semibold>
|
<Text body2 semibold>
|
||||||
{`${item.user.firstname} ${item.user.lastname}`}
|
{`${item.user.firstname !== null ? item.user.firstname : ''} ${item.user.lastname !== null ? item.user.lastname : ''}`}
|
||||||
</Text>
|
</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
{item.beneficiaries.map((beneficiary) => (
|
{item.beneficiaries.map((beneficiary) => (
|
||||||
|
@ -704,7 +741,7 @@ const ExecuterPrescriptionScreen = ({
|
||||||
<View style={{width: 10}}/>
|
<View style={{width: 10}}/>
|
||||||
<View style={{paddingHorizontal: 10, alignItems: 'flex-start'}}>
|
<View style={{paddingHorizontal: 10, alignItems: 'flex-start'}}>
|
||||||
<Text subhead semibold>
|
<Text subhead semibold>
|
||||||
{`${beneficiary.firstname} ${beneficiary.lastname} (${I18n.t('AYANT_DROITS')})`}
|
{`${beneficiary.firstname !== null ? beneficiary.firstname : ''} ${beneficiary.lastname !== null ? beneficiary.lastname : ''} (${I18n.t('AYANT_DROITS')})`}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
|
@ -1048,8 +1085,8 @@ const ExecuterPrescriptionScreen = ({
|
||||||
switch (currentStep) {
|
switch (currentStep) {
|
||||||
case 0:
|
case 0:
|
||||||
console.log("values", values);
|
console.log("values", values);
|
||||||
if (values.numero_assure !== '') {
|
dispatch(fetchGetUserByNameOrNumberReset());
|
||||||
dispatch(fetchGetUserByNameOrNumberReset());
|
if (values.numero_assure !== '' && getUserByNameOrNumber.result === null) {
|
||||||
if (isNumeroAssureSearch)
|
if (isNumeroAssureSearch)
|
||||||
fetchGetUserByNameOrNumber(wallet.id_network, `&insured_id=${values.numero_assure}`);
|
fetchGetUserByNameOrNumber(wallet.id_network, `&insured_id=${values.numero_assure}`);
|
||||||
else if (isPhoneAssureSearch)
|
else if (isPhoneAssureSearch)
|
||||||
|
|
|
@ -362,12 +362,24 @@ const ModifierExecutionPrescriptionScreen = ({
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getUserByNameOrNumber.error) {
|
if (getUserByNameOrNumber.error) {
|
||||||
dropDownAlertRef.alertWithType(
|
Alert.alert(
|
||||||
|
I18n.t("ERROR_LABLE"),
|
||||||
|
Utils.getErrorMsg(getUserByNameOrNumber),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
dispatch(fetchGetUserByNameOrNumberReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
);
|
||||||
|
/* dropDownAlertRef.alertWithType(
|
||||||
'error',
|
'error',
|
||||||
I18n.t('ERROR_LABEL'),
|
I18n.t('ERROR_LABEL'),
|
||||||
Utils.getErrorMsg(getUserByNameOrNumber),
|
Utils.getErrorMsg(getUserByNameOrNumber),
|
||||||
);
|
);
|
||||||
dispatch(fetchGetUserByNameOrNumberReset());
|
dispatch(fetchGetUserByNameOrNumberReset());*/
|
||||||
}
|
}
|
||||||
}, [getUserByNameOrNumber]);
|
}, [getUserByNameOrNumber]);
|
||||||
|
|
||||||
|
@ -377,12 +389,24 @@ const ModifierExecutionPrescriptionScreen = ({
|
||||||
setModalConsultation(true);
|
setModalConsultation(true);
|
||||||
|
|
||||||
if (getConsultation.error) {
|
if (getConsultation.error) {
|
||||||
dropDownAlertRef.alertWithType(
|
Alert.alert(
|
||||||
|
I18n.t("ERROR_LABLE"),
|
||||||
|
Utils.getErrorMsg(getConsultation),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
dispatch(fetchGetConsultationReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
);
|
||||||
|
/* dropDownAlertRef.alertWithType(
|
||||||
'error',
|
'error',
|
||||||
I18n.t('ERROR_LABEL'),
|
I18n.t('ERROR_LABEL'),
|
||||||
Utils.getErrorMsg(getConsultation),
|
Utils.getErrorMsg(getConsultation),
|
||||||
);
|
);
|
||||||
dispatch(fetchGetConsultationReset());
|
dispatch(fetchGetConsultationReset());*/
|
||||||
}
|
}
|
||||||
}, [getConsultation]);
|
}, [getConsultation]);
|
||||||
|
|
||||||
|
@ -405,12 +429,24 @@ const ModifierExecutionPrescriptionScreen = ({
|
||||||
}
|
}
|
||||||
|
|
||||||
if (modifyPrescription.error) {
|
if (modifyPrescription.error) {
|
||||||
dropDownAlertRef.alertWithType(
|
Alert.alert(
|
||||||
|
I18n.t("ERROR_LABLE"),
|
||||||
|
Utils.getErrorMsg(modifyPrescription),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
dispatch(fetchModifyPrescriptionReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
);
|
||||||
|
/* dropDownAlertRef.alertWithType(
|
||||||
'error',
|
'error',
|
||||||
I18n.t('ERROR_LABEL'),
|
I18n.t('ERROR_LABEL'),
|
||||||
Utils.getErrorMsg(modifyPrescription),
|
Utils.getErrorMsg(modifyPrescription),
|
||||||
);
|
);
|
||||||
dispatch(fetchModifyPrescriptionReset());
|
dispatch(fetchModifyPrescriptionReset());*/
|
||||||
}
|
}
|
||||||
}, [modifyPrescription]);
|
}, [modifyPrescription]);
|
||||||
|
|
||||||
|
@ -685,7 +721,7 @@ const ModifierExecutionPrescriptionScreen = ({
|
||||||
}
|
}
|
||||||
}}>
|
}}>
|
||||||
<Text body2 semibold>
|
<Text body2 semibold>
|
||||||
{`${item.user.firstname} ${item.user.lastname}`}
|
{`${item.user.firstname !== null ? item.user.firstname : ''} ${item.user.lastname !== null ? item.user.lastname : ''}`}
|
||||||
</Text>
|
</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
{item.beneficiaries.map((beneficiary) => (
|
{item.beneficiaries.map((beneficiary) => (
|
||||||
|
@ -709,7 +745,7 @@ const ModifierExecutionPrescriptionScreen = ({
|
||||||
<View style={{width: 10}}/>
|
<View style={{width: 10}}/>
|
||||||
<View style={{paddingHorizontal: 10, alignItems: 'flex-start'}}>
|
<View style={{paddingHorizontal: 10, alignItems: 'flex-start'}}>
|
||||||
<Text subhead semibold>
|
<Text subhead semibold>
|
||||||
{`${beneficiary.firstname} ${beneficiary.lastname} (${I18n.t('AYANT_DROITS')})`}
|
{`${beneficiary.firstname !== null ? beneficiary.firstname : ''} ${beneficiary.lastname !== null ? beneficiary.lastname : ''} (${I18n.t('AYANT_DROITS')})`}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
|
@ -1054,7 +1090,7 @@ const ModifierExecutionPrescriptionScreen = ({
|
||||||
switch (currentStep) {
|
switch (currentStep) {
|
||||||
case 0:
|
case 0:
|
||||||
console.log("values", values);
|
console.log("values", values);
|
||||||
if (values.numero_assure !== '') {
|
if (values.numero_assure !== '' && getUserByNameOrNumber.result === null) {
|
||||||
dispatch(fetchGetUserByNameOrNumberReset());
|
dispatch(fetchGetUserByNameOrNumberReset());
|
||||||
if (isNumeroAssureSearch)
|
if (isNumeroAssureSearch)
|
||||||
fetchGetUserByNameOrNumber(wallet.id_network, `&insured_id=${values.numero_assure}`);
|
fetchGetUserByNameOrNumber(wallet.id_network, `&insured_id=${values.numero_assure}`);
|
||||||
|
|
|
@ -428,12 +428,24 @@ const ModifierFeuilleSoinScreen = ({
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getUserByNameOrNumber.error) {
|
if (getUserByNameOrNumber.error) {
|
||||||
dropDownAlertRef.alertWithType(
|
Alert.alert(
|
||||||
|
I18n.t("ERROR_LABLE"),
|
||||||
|
Utils.getErrorMsg(getUserByNameOrNumber),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
dispatch(fetchGetUserByNameOrNumberReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
);
|
||||||
|
/* dropDownAlertRef.alertWithType(
|
||||||
'error',
|
'error',
|
||||||
I18n.t('ERROR_LABEL'),
|
I18n.t('ERROR_LABEL'),
|
||||||
Utils.getErrorMsg(getUserByNameOrNumber),
|
Utils.getErrorMsg(getUserByNameOrNumber),
|
||||||
);
|
);
|
||||||
dispatch(fetchGetUserByNameOrNumberReset());
|
dispatch(fetchGetUserByNameOrNumberReset());*/
|
||||||
}
|
}
|
||||||
}, [getUserByNameOrNumber]);
|
}, [getUserByNameOrNumber]);
|
||||||
|
|
||||||
|
@ -443,12 +455,24 @@ const ModifierFeuilleSoinScreen = ({
|
||||||
setModalConsultation(true);
|
setModalConsultation(true);
|
||||||
|
|
||||||
if (getConsultation.error) {
|
if (getConsultation.error) {
|
||||||
dropDownAlertRef.alertWithType(
|
Alert.alert(
|
||||||
|
I18n.t("ERROR_LABLE"),
|
||||||
|
Utils.getErrorMsg(getConsultation),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
dispatch(fetchGetConsultationReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
);
|
||||||
|
/* dropDownAlertRef.alertWithType(
|
||||||
'error',
|
'error',
|
||||||
I18n.t('ERROR_LABEL'),
|
I18n.t('ERROR_LABEL'),
|
||||||
Utils.getErrorMsg(getConsultation),
|
Utils.getErrorMsg(getConsultation),
|
||||||
);
|
);
|
||||||
dispatch(fetchGetConsultationReset());
|
dispatch(fetchGetConsultationReset());*/
|
||||||
}
|
}
|
||||||
}, [getConsultation]);
|
}, [getConsultation]);
|
||||||
|
|
||||||
|
@ -471,12 +495,24 @@ const ModifierFeuilleSoinScreen = ({
|
||||||
}
|
}
|
||||||
|
|
||||||
if (modifyPrescription.error) {
|
if (modifyPrescription.error) {
|
||||||
dropDownAlertRef.alertWithType(
|
Alert.alert(
|
||||||
|
I18n.t("ERROR_LABLE"),
|
||||||
|
Utils.getErrorMsg(modifyPrescription),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
dispatch(fetchModifyPrescriptionReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
);
|
||||||
|
/* dropDownAlertRef.alertWithType(
|
||||||
'error',
|
'error',
|
||||||
I18n.t('ERROR_LABEL'),
|
I18n.t('ERROR_LABEL'),
|
||||||
Utils.getErrorMsg(modifyPrescription),
|
Utils.getErrorMsg(modifyPrescription),
|
||||||
);
|
);
|
||||||
dispatch(fetchModifyPrescriptionReset());
|
dispatch(fetchModifyPrescriptionReset());*/
|
||||||
}
|
}
|
||||||
}, [modifyPrescription]);
|
}, [modifyPrescription]);
|
||||||
|
|
||||||
|
@ -1971,7 +2007,7 @@ const ModifierFeuilleSoinScreen = ({
|
||||||
}
|
}
|
||||||
}}>
|
}}>
|
||||||
<Text body2 semibold>
|
<Text body2 semibold>
|
||||||
{`${item.user.firstname} ${item.user.lastname}`}
|
{`${item.user.firstname !== null ? item.user.firstname : ''} ${item.user.lastname !== null ? item.user.lastname : ''}`}
|
||||||
</Text>
|
</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
{item.beneficiaries.map((beneficiary) => (
|
{item.beneficiaries.map((beneficiary) => (
|
||||||
|
@ -1994,7 +2030,7 @@ const ModifierFeuilleSoinScreen = ({
|
||||||
<View style={{width: 10}}/>
|
<View style={{width: 10}}/>
|
||||||
<View style={{paddingHorizontal: 10, alignItems: 'flex-start'}}>
|
<View style={{paddingHorizontal: 10, alignItems: 'flex-start'}}>
|
||||||
<Text subhead semibold>
|
<Text subhead semibold>
|
||||||
{`${beneficiary.firstname} ${beneficiary.lastname} (${I18n.t('AYANT_DROITS')})`}
|
{`${beneficiary.firstname !== null ? beneficiary.firstname : ''} ${beneficiary.lastname !== null ? beneficiary.lastname : ''} (${I18n.t('AYANT_DROITS')})`}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
|
@ -2383,7 +2419,7 @@ const ModifierFeuilleSoinScreen = ({
|
||||||
switch (currentStep) {
|
switch (currentStep) {
|
||||||
case 0:
|
case 0:
|
||||||
console.log("values", values);
|
console.log("values", values);
|
||||||
if (values.numero_assure !== '') {
|
if (values.numero_assure !== '' && getUserByNameOrNumber.result === null) {
|
||||||
dispatch(fetchGetUserByNameOrNumberReset());
|
dispatch(fetchGetUserByNameOrNumberReset());
|
||||||
if (isNumeroAssureSearch)
|
if (isNumeroAssureSearch)
|
||||||
fetchGetUserByNameOrNumber(wallet.id_network, `&insured_id=${values.numero_assure}`);
|
fetchGetUserByNameOrNumber(wallet.id_network, `&insured_id=${values.numero_assure}`);
|
||||||
|
|
|
@ -48,7 +48,7 @@ import {
|
||||||
fetchGetUserByIdQRCode,
|
fetchGetUserByIdQRCode,
|
||||||
fetchGetUserByIdQRCodeReset,
|
fetchGetUserByIdQRCodeReset,
|
||||||
fetchGetUserByNameOrNumber,
|
fetchGetUserByNameOrNumber,
|
||||||
fetchGetUserByNameOrNumberReset
|
fetchGetUserByNameOrNumberReset, fetchModifyPrescriptionReset
|
||||||
} from "../../../redux/insurance/insurance.actions";
|
} from "../../../redux/insurance/insurance.actions";
|
||||||
import DropdownAlert from "react-native-dropdownalert";
|
import DropdownAlert from "react-native-dropdownalert";
|
||||||
import {readUser} from "../../../webservice/AuthApi";
|
import {readUser} from "../../../webservice/AuthApi";
|
||||||
|
@ -403,12 +403,24 @@ const SaisirFeuilleSoinScreen = ({
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getUserByNameOrNumber.error) {
|
if (getUserByNameOrNumber.error) {
|
||||||
dropDownAlertRef.alertWithType(
|
Alert.alert(
|
||||||
|
I18n.t("ERROR_LABLE"),
|
||||||
|
Utils.getErrorMsg(getUserByNameOrNumber),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
dispatch(fetchGetUserByNameOrNumberReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
);
|
||||||
|
/* dropDownAlertRef.alertWithType(
|
||||||
'error',
|
'error',
|
||||||
I18n.t('ERROR_LABEL'),
|
I18n.t('ERROR_LABEL'),
|
||||||
Utils.getErrorMsg(getUserByNameOrNumber),
|
Utils.getErrorMsg(getUserByNameOrNumber),
|
||||||
);
|
);
|
||||||
dispatch(fetchGetUserByNameOrNumberReset());
|
dispatch(fetchGetUserByNameOrNumberReset());*/
|
||||||
}
|
}
|
||||||
}, [getUserByNameOrNumber]);
|
}, [getUserByNameOrNumber]);
|
||||||
|
|
||||||
|
@ -436,12 +448,24 @@ const SaisirFeuilleSoinScreen = ({
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getDrugAppareil.error) {
|
if (getDrugAppareil.error) {
|
||||||
dropDownAlertRef.alertWithType(
|
Alert.alert(
|
||||||
|
I18n.t("ERROR_LABLE"),
|
||||||
|
Utils.getErrorMsg(getDrugAppareil),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
dispatch(fetchGetDrugAppareilReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
);
|
||||||
|
/* dropDownAlertRef.alertWithType(
|
||||||
'error',
|
'error',
|
||||||
I18n.t('ERROR_LABEL'),
|
I18n.t('ERROR_LABEL'),
|
||||||
Utils.getErrorMsg(getDrugAppareil),
|
Utils.getErrorMsg(getDrugAppareil),
|
||||||
);
|
);
|
||||||
dispatch(fetchGetDrugAppareilReset());
|
dispatch(fetchGetDrugAppareilReset());*/
|
||||||
}
|
}
|
||||||
}, [getDrugAppareil]);
|
}, [getDrugAppareil]);
|
||||||
|
|
||||||
|
@ -452,12 +476,24 @@ const SaisirFeuilleSoinScreen = ({
|
||||||
}
|
}
|
||||||
|
|
||||||
if (addDrug.error) {
|
if (addDrug.error) {
|
||||||
dropDownAlertRef.alertWithType(
|
Alert.alert(
|
||||||
|
I18n.t("ERROR_LABLE"),
|
||||||
|
Utils.getErrorMsg(addDrug),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
dispatch(fetchAddDrugReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
);
|
||||||
|
/* dropDownAlertRef.alertWithType(
|
||||||
'error',
|
'error',
|
||||||
I18n.t('ERROR_LABEL'),
|
I18n.t('ERROR_LABEL'),
|
||||||
Utils.getErrorMsg(addDrug),
|
Utils.getErrorMsg(addDrug),
|
||||||
);
|
);
|
||||||
dispatch(fetchAddDrugReset());
|
dispatch(fetchAddDrugReset());*/
|
||||||
}
|
}
|
||||||
}, [addDrug]);
|
}, [addDrug]);
|
||||||
|
|
||||||
|
@ -480,12 +516,24 @@ const SaisirFeuilleSoinScreen = ({
|
||||||
}
|
}
|
||||||
|
|
||||||
if (createConsultation.error) {
|
if (createConsultation.error) {
|
||||||
dropDownAlertRef.alertWithType(
|
Alert.alert(
|
||||||
|
I18n.t("ERROR_LABLE"),
|
||||||
|
Utils.getErrorMsg(createConsultation),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
dispatch(fetchCreateConsultationReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
);
|
||||||
|
/* dropDownAlertRef.alertWithType(
|
||||||
'error',
|
'error',
|
||||||
I18n.t('ERROR_LABEL'),
|
I18n.t('ERROR_LABEL'),
|
||||||
Utils.getErrorMsg(createConsultation),
|
Utils.getErrorMsg(createConsultation),
|
||||||
);
|
);
|
||||||
dispatch(fetchCreateConsultationReset());
|
dispatch(fetchCreateConsultationReset());*/
|
||||||
}
|
}
|
||||||
}, [createConsultation]);
|
}, [createConsultation]);
|
||||||
|
|
||||||
|
@ -1246,13 +1294,13 @@ const SaisirFeuilleSoinScreen = ({
|
||||||
'firstname_patient',
|
'firstname_patient',
|
||||||
item.user.firstname,
|
item.user.firstname,
|
||||||
);
|
);
|
||||||
fetchGetNetworkActs(wallet.id_network, '', `&user_id=${item.id}`);
|
fetchGetNetworkActs(wallet.id_network, '', `&user_id=${item.user.id}`);
|
||||||
dispatch(fetchGetUserByNameOrNumberReset());
|
dispatch(fetchGetUserByNameOrNumberReset());
|
||||||
wizard.current.next();
|
wizard.current.next();
|
||||||
}
|
}
|
||||||
}}>
|
}}>
|
||||||
<Text body2 semibold>
|
<Text body2 semibold>
|
||||||
{`${item.user.firstname} ${item.user.lastname}`}
|
{`${item.user.firstname !== null ? item.user.firstname : ''} ${item.user.lastname !== null ? item.user.lastname : ''}`}
|
||||||
</Text>
|
</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
{item.beneficiaries.map((beneficiary) => (
|
{item.beneficiaries.map((beneficiary) => (
|
||||||
|
@ -1270,14 +1318,14 @@ const SaisirFeuilleSoinScreen = ({
|
||||||
'firstname_patient',
|
'firstname_patient',
|
||||||
beneficiary.firstname,
|
beneficiary.firstname,
|
||||||
);
|
);
|
||||||
fetchGetNetworkActs(wallet.id_network, '', `&user_id=${item.id}&beneficiary_id=${beneficiary.id}`);
|
fetchGetNetworkActs(wallet.id_network, '', `&user_id=${item.user.id}&beneficiary_id=${beneficiary.id}`);
|
||||||
dispatch(fetchGetUserByNameOrNumberReset());
|
dispatch(fetchGetUserByNameOrNumberReset());
|
||||||
wizard.current.next();
|
wizard.current.next();
|
||||||
}}>
|
}}>
|
||||||
<View style={{width: 10}}/>
|
<View style={{width: 10}}/>
|
||||||
<View style={{paddingHorizontal: 10, alignItems: 'flex-start'}}>
|
<View style={{paddingHorizontal: 10, alignItems: 'flex-start'}}>
|
||||||
<Text subhead semibold>
|
<Text subhead semibold>
|
||||||
{`${beneficiary.firstname} ${beneficiary.lastname} (${I18n.t('AYANT_DROITS')})`}
|
{`${beneficiary.firstname !== null ? beneficiary.firstname : ''} ${beneficiary.lastname !== null ? beneficiary.lastname : ''} (${I18n.t('AYANT_DROITS')})`}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
|
@ -1387,11 +1435,22 @@ const SaisirFeuilleSoinScreen = ({
|
||||||
onSubmit: values => {
|
onSubmit: values => {
|
||||||
|
|
||||||
if (prestations.length === 0) {
|
if (prestations.length === 0) {
|
||||||
dropDownAlertRef.alertWithType(
|
Alert.alert(
|
||||||
|
I18n.t("ERROR_LABLE"),
|
||||||
|
I18n.t('YOU_MUST_ADD_AT_LEAST_ONE_PRESTATION'),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
);
|
||||||
|
/* dropDownAlertRef.alertWithType(
|
||||||
'error',
|
'error',
|
||||||
I18n.t('ERROR_LABEL'),
|
I18n.t('ERROR_LABEL'),
|
||||||
I18n.t('YOU_MUST_ADD_AT_LEAST_ONE_PRESTATION'),
|
I18n.t('YOU_MUST_ADD_AT_LEAST_ONE_PRESTATION'),
|
||||||
);
|
);*/
|
||||||
} else {
|
} else {
|
||||||
fetchCreateConsultation({
|
fetchCreateConsultation({
|
||||||
insured_id: assure.insured_id,
|
insured_id: assure.insured_id,
|
||||||
|
@ -1418,8 +1477,8 @@ const SaisirFeuilleSoinScreen = ({
|
||||||
switch (currentStep) {
|
switch (currentStep) {
|
||||||
case 0:
|
case 0:
|
||||||
console.log("values", values);
|
console.log("values", values);
|
||||||
if (values.numero_assure !== '') {
|
dispatch(fetchGetUserByNameOrNumberReset());
|
||||||
dispatch(fetchGetUserByNameOrNumberReset());
|
if (values.numero_assure !== '' && getUserByNameOrNumber.result === null) {
|
||||||
if (isNumeroAssureSearch)
|
if (isNumeroAssureSearch)
|
||||||
fetchGetUserByNameOrNumber(wallet.id_network, `&insured_id=${values.numero_assure}`);
|
fetchGetUserByNameOrNumber(wallet.id_network, `&insured_id=${values.numero_assure}`);
|
||||||
else if (isPhoneAssureSearch)
|
else if (isPhoneAssureSearch)
|
||||||
|
|
|
@ -20,7 +20,7 @@ import FontAwesome from "react-native-vector-icons/FontAwesome";
|
||||||
import {responsiveWidth} from "react-native-responsive-dimensions";
|
import {responsiveWidth} from "react-native-responsive-dimensions";
|
||||||
import {
|
import {
|
||||||
fetchActivePaySubscription,
|
fetchActivePaySubscription,
|
||||||
fetchActivePaySubscriptionReset,
|
fetchActivePaySubscriptionReset, fetchCreateConsultationReset,
|
||||||
fetchGetSubscriptionList,
|
fetchGetSubscriptionList,
|
||||||
fetchGetSubscriptionListReset
|
fetchGetSubscriptionListReset
|
||||||
} from "../../../redux/insurance/insurance.actions";
|
} from "../../../redux/insurance/insurance.actions";
|
||||||
|
@ -216,12 +216,24 @@ const ActivateBuySubscriptionScreen = ({
|
||||||
}
|
}
|
||||||
|
|
||||||
if (subscriptionList.error) {
|
if (subscriptionList.error) {
|
||||||
dropDownAlertRef.alertWithType(
|
Alert.alert(
|
||||||
|
I18n.t("ERROR_LABLE"),
|
||||||
|
Utils.getErrorMsg(subscriptionList),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
dispatch(fetchGetSubscriptionListReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
);
|
||||||
|
/* dropDownAlertRef.alertWithType(
|
||||||
'error',
|
'error',
|
||||||
I18n.t('ERROR_LABEL'),
|
I18n.t('ERROR_LABEL'),
|
||||||
Utils.getErrorMsg(subscriptionList),
|
Utils.getErrorMsg(subscriptionList),
|
||||||
);
|
);
|
||||||
dispatch(fetchGetSubscriptionListReset());
|
dispatch(fetchGetSubscriptionListReset());*/
|
||||||
}
|
}
|
||||||
}, [subscriptionList]);
|
}, [subscriptionList]);
|
||||||
|
|
||||||
|
@ -244,12 +256,24 @@ const ActivateBuySubscriptionScreen = ({
|
||||||
}
|
}
|
||||||
|
|
||||||
if (activatePaySubscription.error) {
|
if (activatePaySubscription.error) {
|
||||||
dropDownAlertRef.alertWithType(
|
Alert.alert(
|
||||||
|
I18n.t("ERROR_LABLE"),
|
||||||
|
Utils.getErrorMsg(activatePaySubscription),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
dispatch(fetchActivePaySubscriptionReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
);
|
||||||
|
/* dropDownAlertRef.alertWithType(
|
||||||
'error',
|
'error',
|
||||||
I18n.t('ERROR_LABEL'),
|
I18n.t('ERROR_LABEL'),
|
||||||
Utils.getErrorMsg(activatePaySubscription),
|
Utils.getErrorMsg(activatePaySubscription),
|
||||||
);
|
);
|
||||||
dispatch(fetchActivePaySubscriptionReset());
|
dispatch(fetchActivePaySubscriptionReset());*/
|
||||||
}
|
}
|
||||||
}, [activatePaySubscription]);
|
}, [activatePaySubscription]);
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,7 @@ import {responsiveWidth} from "react-native-responsive-dimensions";
|
||||||
import SwitchSelector from "react-native-switch-selector";
|
import SwitchSelector from "react-native-switch-selector";
|
||||||
import MaterialCommunityIcons from "react-native-vector-icons/MaterialCommunityIcons";
|
import MaterialCommunityIcons from "react-native-vector-icons/MaterialCommunityIcons";
|
||||||
import {
|
import {
|
||||||
|
fetchActivePaySubscriptionReset,
|
||||||
fetchAddBeneficiaryToSubscription,
|
fetchAddBeneficiaryToSubscription,
|
||||||
fetchAddBeneficiaryToSubscriptionReset,
|
fetchAddBeneficiaryToSubscriptionReset,
|
||||||
fetchGetInsurancePrimeAmount,
|
fetchGetInsurancePrimeAmount,
|
||||||
|
@ -303,12 +304,24 @@ const AddBeneficiaryScreen = ({
|
||||||
}
|
}
|
||||||
|
|
||||||
if (subscriptionList.error) {
|
if (subscriptionList.error) {
|
||||||
dropDownAlertRef.alertWithType(
|
Alert.alert(
|
||||||
|
I18n.t("ERROR_LABLE"),
|
||||||
|
Utils.getErrorMsg(subscriptionList),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
dispatch(fetchGetListInsuranceReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
);
|
||||||
|
/* dropDownAlertRef.alertWithType(
|
||||||
'error',
|
'error',
|
||||||
I18n.t('ERROR_LABEL'),
|
I18n.t('ERROR_LABEL'),
|
||||||
Utils.getErrorMsg(subscriptionList),
|
Utils.getErrorMsg(subscriptionList),
|
||||||
);
|
);
|
||||||
dispatch(fetchGetListInsuranceReset());
|
dispatch(fetchGetListInsuranceReset());*/
|
||||||
}
|
}
|
||||||
}, [subscriptionList]);
|
}, [subscriptionList]);
|
||||||
|
|
||||||
|
@ -331,12 +344,24 @@ const AddBeneficiaryScreen = ({
|
||||||
}
|
}
|
||||||
|
|
||||||
if (addBeneficiaryToSubscription.error) {
|
if (addBeneficiaryToSubscription.error) {
|
||||||
dropDownAlertRef.alertWithType(
|
Alert.alert(
|
||||||
|
I18n.t("ERROR_LABLE"),
|
||||||
|
Utils.getErrorMsg(addBeneficiaryToSubscription),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
dispatch(fetchSubscribeInsuranceReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
);
|
||||||
|
/* dropDownAlertRef.alertWithType(
|
||||||
'error',
|
'error',
|
||||||
I18n.t('ERROR_LABEL'),
|
I18n.t('ERROR_LABEL'),
|
||||||
Utils.getErrorMsg(addBeneficiaryToSubscription),
|
Utils.getErrorMsg(addBeneficiaryToSubscription),
|
||||||
);
|
);
|
||||||
dispatch(fetchSubscribeInsuranceReset());
|
dispatch(fetchSubscribeInsuranceReset());*/
|
||||||
}
|
}
|
||||||
}, [addBeneficiaryToSubscription]);
|
}, [addBeneficiaryToSubscription]);
|
||||||
|
|
||||||
|
@ -347,11 +372,22 @@ const AddBeneficiaryScreen = ({
|
||||||
|
|
||||||
if (subscription !== null) {
|
if (subscription !== null) {
|
||||||
if (beneficiaries.length === parseInt(subscription.max_number_of_beneficiaries)) {
|
if (beneficiaries.length === parseInt(subscription.max_number_of_beneficiaries)) {
|
||||||
dropDownAlertRef.alertWithType(
|
Alert.alert(
|
||||||
|
I18n.t("ERROR_LABLE"),
|
||||||
|
I18n.t('NUMBER_MAX_BENEFICIARY'),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
);
|
||||||
|
/* dropDownAlertRef.alertWithType(
|
||||||
'error',
|
'error',
|
||||||
I18n.t('ERROR_LABEL'),
|
I18n.t('ERROR_LABEL'),
|
||||||
I18n.t('NUMBER_MAX_BENEFICIARY'),
|
I18n.t('NUMBER_MAX_BENEFICIARY'),
|
||||||
);
|
);*/
|
||||||
} else {
|
} else {
|
||||||
console.log("affiliation", affiliation);
|
console.log("affiliation", affiliation);
|
||||||
let beneficiariesTemp = beneficiaries;
|
let beneficiariesTemp = beneficiaries;
|
||||||
|
@ -381,12 +417,24 @@ const AddBeneficiaryScreen = ({
|
||||||
}
|
}
|
||||||
|
|
||||||
if (uploadInsuranceImages.error) {
|
if (uploadInsuranceImages.error) {
|
||||||
dropDownAlertRef.alertWithType(
|
Alert.alert(
|
||||||
|
I18n.t("ERROR_LABLE"),
|
||||||
|
Utils.getErrorMsg(uploadInsuranceImages),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
dispatch(fetchUploadInsuranceReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
);
|
||||||
|
/* dropDownAlertRef.alertWithType(
|
||||||
'error',
|
'error',
|
||||||
I18n.t('ERROR_LABEL'),
|
I18n.t('ERROR_LABEL'),
|
||||||
Utils.getErrorMsg(uploadInsuranceImages),
|
Utils.getErrorMsg(uploadInsuranceImages),
|
||||||
);
|
);
|
||||||
dispatch(fetchUploadInsuranceReset());
|
dispatch(fetchUploadInsuranceReset());*/
|
||||||
}
|
}
|
||||||
}, [uploadInsuranceImages]);
|
}, [uploadInsuranceImages]);
|
||||||
|
|
||||||
|
@ -959,7 +1007,7 @@ const AddBeneficiaryScreen = ({
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
if (subscription === null) {
|
if (subscription === null) {
|
||||||
dropDownAlertRef.alertWithType(
|
dropDownAlertRef.alertWithType(
|
||||||
'error',
|
'warn',
|
||||||
I18n.t('ERROR_LABEL'),
|
I18n.t('ERROR_LABEL'),
|
||||||
I18n.t('PLEASE_SELECT_INSURANCE_BEFORE'),
|
I18n.t('PLEASE_SELECT_INSURANCE_BEFORE'),
|
||||||
);
|
);
|
||||||
|
|
|
@ -250,12 +250,24 @@ const DeleteBeneficiaryScreen = ({
|
||||||
}
|
}
|
||||||
|
|
||||||
if (subscriptionList.error) {
|
if (subscriptionList.error) {
|
||||||
dropDownAlertRef.alertWithType(
|
Alert.alert(
|
||||||
|
I18n.t("ERROR_LABLE"),
|
||||||
|
Utils.getErrorMsg(subscriptionList),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
dispatch(fetchGetListInsuranceReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
);
|
||||||
|
/* dropDownAlertRef.alertWithType(
|
||||||
'error',
|
'error',
|
||||||
I18n.t('ERROR_LABEL'),
|
I18n.t('ERROR_LABEL'),
|
||||||
Utils.getErrorMsg(subscriptionList),
|
Utils.getErrorMsg(subscriptionList),
|
||||||
);
|
);
|
||||||
dispatch(fetchGetListInsuranceReset());
|
dispatch(fetchGetListInsuranceReset());*/
|
||||||
}
|
}
|
||||||
}, [subscriptionList]);
|
}, [subscriptionList]);
|
||||||
|
|
||||||
|
@ -278,12 +290,24 @@ const DeleteBeneficiaryScreen = ({
|
||||||
}
|
}
|
||||||
|
|
||||||
if (deleteBeneficiary.error) {
|
if (deleteBeneficiary.error) {
|
||||||
dropDownAlertRef.alertWithType(
|
Alert.alert(
|
||||||
|
I18n.t("ERROR_LABLE"),
|
||||||
|
Utils.getErrorMsg(deleteBeneficiary),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
dispatch(fetchDeleteBeneficiaryReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
);
|
||||||
|
/* dropDownAlertRef.alertWithType(
|
||||||
'error',
|
'error',
|
||||||
I18n.t('ERROR_LABEL'),
|
I18n.t('ERROR_LABEL'),
|
||||||
Utils.getErrorMsg(deleteBeneficiary),
|
Utils.getErrorMsg(deleteBeneficiary),
|
||||||
);
|
);
|
||||||
dispatch(fetchDeleteBeneficiaryReset());
|
dispatch(fetchDeleteBeneficiaryReset());*/
|
||||||
}
|
}
|
||||||
}, [deleteBeneficiary]);
|
}, [deleteBeneficiary]);
|
||||||
|
|
||||||
|
|
|
@ -25,11 +25,15 @@ import {ScreenComponent} from "../../../components/ScreenComponent";
|
||||||
import {
|
import {
|
||||||
fetchAcceptRejectConsultation,
|
fetchAcceptRejectConsultation,
|
||||||
fetchAcceptRejectConsultationReset,
|
fetchAcceptRejectConsultationReset,
|
||||||
fetchActivePaySubscription, fetchDemaneAutorisationSoin, fetchDemaneAutorisationSoinReset,
|
fetchActivePaySubscription,
|
||||||
|
fetchDeleteBeneficiaryReset,
|
||||||
|
fetchDemaneAutorisationSoin,
|
||||||
|
fetchDemaneAutorisationSoinReset,
|
||||||
fetchGetConsultation,
|
fetchGetConsultation,
|
||||||
fetchGetConsultationReset,
|
fetchGetConsultationReset,
|
||||||
fetchGetListInsurance,
|
fetchGetListInsurance,
|
||||||
fetchGetListInsuranceReset, fetchGetListInsuranceWithBeneficiaries,
|
fetchGetListInsuranceReset,
|
||||||
|
fetchGetListInsuranceWithBeneficiaries,
|
||||||
fetchGetNetworkActs
|
fetchGetNetworkActs
|
||||||
} from "../../../redux/insurance/insurance.actions";
|
} from "../../../redux/insurance/insurance.actions";
|
||||||
import DropdownAlert from "react-native-dropdownalert";
|
import DropdownAlert from "react-native-dropdownalert";
|
||||||
|
@ -111,12 +115,24 @@ const DemandeAutorisationSoinScreen = ({
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (getConsultation.error) {
|
if (getConsultation.error) {
|
||||||
dropDownAlertRef.alertWithType(
|
Alert.alert(
|
||||||
|
I18n.t("ERROR_LABLE"),
|
||||||
|
Utils.getErrorMsg(getConsultation),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
dispatch(fetchGetConsultationReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
);
|
||||||
|
/* dropDownAlertRef.alertWithType(
|
||||||
'error',
|
'error',
|
||||||
I18n.t('ERROR_LABEL'),
|
I18n.t('ERROR_LABEL'),
|
||||||
Utils.getErrorMsg(getConsultation),
|
Utils.getErrorMsg(getConsultation),
|
||||||
);
|
);
|
||||||
dispatch(fetchGetConsultationReset());
|
dispatch(fetchGetConsultationReset());*/
|
||||||
}
|
}
|
||||||
}, [getConsultation]);
|
}, [getConsultation]);
|
||||||
|
|
||||||
|
@ -132,12 +148,24 @@ const DemandeAutorisationSoinScreen = ({
|
||||||
}
|
}
|
||||||
|
|
||||||
if (insuranceList.error) {
|
if (insuranceList.error) {
|
||||||
dropDownAlertRef.alertWithType(
|
Alert.alert(
|
||||||
|
I18n.t("ERROR_LABLE"),
|
||||||
|
Utils.getErrorMsg(insuranceList),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
dispatch(fetchGetListInsuranceReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
);
|
||||||
|
/* dropDownAlertRef.alertWithType(
|
||||||
'error',
|
'error',
|
||||||
I18n.t('ERROR_LABEL'),
|
I18n.t('ERROR_LABEL'),
|
||||||
Utils.getErrorMsg(insuranceList),
|
Utils.getErrorMsg(insuranceList),
|
||||||
);
|
);
|
||||||
dispatch(fetchGetListInsuranceReset());
|
dispatch(fetchGetListInsuranceReset());*/
|
||||||
}
|
}
|
||||||
}, [insuranceList]);
|
}, [insuranceList]);
|
||||||
|
|
||||||
|
@ -160,12 +188,24 @@ const DemandeAutorisationSoinScreen = ({
|
||||||
}
|
}
|
||||||
|
|
||||||
if (demandeAutorisationSoin.error) {
|
if (demandeAutorisationSoin.error) {
|
||||||
dropDownAlertRef.alertWithType(
|
Alert.alert(
|
||||||
|
I18n.t("ERROR_LABLE"),
|
||||||
|
Utils.getErrorMsg(demandeAutorisationSoin),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
dispatch(fetchDemaneAutorisationSoinReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
);
|
||||||
|
/* dropDownAlertRef.alertWithType(
|
||||||
'error',
|
'error',
|
||||||
I18n.t('ERROR_LABEL'),
|
I18n.t('ERROR_LABEL'),
|
||||||
Utils.getErrorMsg(demandeAutorisationSoin),
|
Utils.getErrorMsg(demandeAutorisationSoin),
|
||||||
);
|
);
|
||||||
dispatch(fetchDemaneAutorisationSoinReset());
|
dispatch(fetchDemaneAutorisationSoinReset());*/
|
||||||
}
|
}
|
||||||
}, [demandeAutorisationSoin]);
|
}, [demandeAutorisationSoin]);
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*/
|
*/
|
||||||
import React, {useEffect, useState} from 'react';
|
import React, {useEffect, useState} from 'react';
|
||||||
import {
|
import {
|
||||||
ActivityIndicator,
|
ActivityIndicator, Alert,
|
||||||
Dimensions,
|
Dimensions,
|
||||||
FlatList,
|
FlatList,
|
||||||
Platform,
|
Platform,
|
||||||
|
@ -25,7 +25,7 @@ import {ScreenComponent} from "../../../components/ScreenComponent";
|
||||||
import {
|
import {
|
||||||
fetchAcceptRejectConsultation,
|
fetchAcceptRejectConsultation,
|
||||||
fetchAcceptRejectConsultationReset,
|
fetchAcceptRejectConsultationReset,
|
||||||
fetchActivePaySubscription,
|
fetchActivePaySubscription, fetchDemaneAutorisationSoinReset,
|
||||||
fetchGetConsultation,
|
fetchGetConsultation,
|
||||||
fetchGetConsultationReset, fetchGetDemandeAutorisationSoin,
|
fetchGetConsultationReset, fetchGetDemandeAutorisationSoin,
|
||||||
fetchGetSubscription
|
fetchGetSubscription
|
||||||
|
@ -106,12 +106,24 @@ const HistoriqueNanoSanteUserScreen = ({
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getConsultation.error) {
|
if (getConsultation.error) {
|
||||||
dropDownAlertRef.alertWithType(
|
Alert.alert(
|
||||||
|
I18n.t("ERROR_LABLE"),
|
||||||
|
Utils.getErrorMsg(getConsultation),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
dispatch(fetchGetConsultationReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
);
|
||||||
|
/* dropDownAlertRef.alertWithType(
|
||||||
'error',
|
'error',
|
||||||
I18n.t('ERROR_LABEL'),
|
I18n.t('ERROR_LABEL'),
|
||||||
Utils.getErrorMsg(getConsultation),
|
Utils.getErrorMsg(getConsultation),
|
||||||
);
|
);
|
||||||
dispatch(fetchGetConsultationReset());
|
dispatch(fetchGetConsultationReset());*/
|
||||||
}
|
}
|
||||||
//forceUpdate();
|
//forceUpdate();
|
||||||
}, [getConsultation]);
|
}, [getConsultation]);
|
||||||
|
|
|
@ -36,6 +36,7 @@ import {responsiveWidth} from "react-native-responsive-dimensions";
|
||||||
import SwitchSelector from "react-native-switch-selector";
|
import SwitchSelector from "react-native-switch-selector";
|
||||||
import MaterialCommunityIcons from "react-native-vector-icons/MaterialCommunityIcons";
|
import MaterialCommunityIcons from "react-native-vector-icons/MaterialCommunityIcons";
|
||||||
import {
|
import {
|
||||||
|
fetchGetConsultationReset,
|
||||||
fetchGetInsurancePrimeAmount,
|
fetchGetInsurancePrimeAmount,
|
||||||
fetchGetInsurancePrimeAmountReset,
|
fetchGetInsurancePrimeAmountReset,
|
||||||
fetchGetListInsurance,
|
fetchGetListInsurance,
|
||||||
|
@ -291,12 +292,24 @@ const InsuranceSubscriptionScreen = ({
|
||||||
}
|
}
|
||||||
|
|
||||||
if (insuranceList.error) {
|
if (insuranceList.error) {
|
||||||
dropDownAlertRef.alertWithType(
|
Alert.alert(
|
||||||
|
I18n.t("ERROR_LABLE"),
|
||||||
|
Utils.getErrorMsg(insuranceList),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
dispatch(fetchGetListInsuranceReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
);
|
||||||
|
/* dropDownAlertRef.alertWithType(
|
||||||
'error',
|
'error',
|
||||||
I18n.t('ERROR_LABEL'),
|
I18n.t('ERROR_LABEL'),
|
||||||
Utils.getErrorMsg(insuranceList),
|
Utils.getErrorMsg(insuranceList),
|
||||||
);
|
);
|
||||||
dispatch(fetchGetListInsuranceReset());
|
dispatch(fetchGetListInsuranceReset());*/
|
||||||
}
|
}
|
||||||
}, [insuranceList]);
|
}, [insuranceList]);
|
||||||
|
|
||||||
|
@ -319,12 +332,24 @@ const InsuranceSubscriptionScreen = ({
|
||||||
}
|
}
|
||||||
|
|
||||||
if (subscribeInsurance.error) {
|
if (subscribeInsurance.error) {
|
||||||
dropDownAlertRef.alertWithType(
|
Alert.alert(
|
||||||
|
I18n.t("ERROR_LABLE"),
|
||||||
|
Utils.getErrorMsg(subscribeInsurance),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
dispatch(fetchSubscribeInsuranceReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
);
|
||||||
|
/* dropDownAlertRef.alertWithType(
|
||||||
'error',
|
'error',
|
||||||
I18n.t('ERROR_LABEL'),
|
I18n.t('ERROR_LABEL'),
|
||||||
Utils.getErrorMsg(subscribeInsurance),
|
Utils.getErrorMsg(subscribeInsurance),
|
||||||
);
|
);
|
||||||
dispatch(fetchSubscribeInsuranceReset());
|
dispatch(fetchSubscribeInsuranceReset());*/
|
||||||
}
|
}
|
||||||
}, [subscribeInsurance]);
|
}, [subscribeInsurance]);
|
||||||
|
|
||||||
|
@ -333,12 +358,24 @@ const InsuranceSubscriptionScreen = ({
|
||||||
setShowModalDetail(true);
|
setShowModalDetail(true);
|
||||||
|
|
||||||
if (insurancePrimeAmount.error) {
|
if (insurancePrimeAmount.error) {
|
||||||
dropDownAlertRef.alertWithType(
|
Alert.alert(
|
||||||
|
I18n.t("ERROR_LABLE"),
|
||||||
|
Utils.getErrorMsg(insurancePrimeAmount),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
dispatch(fetchGetInsurancePrimeAmountReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
);
|
||||||
|
/* dropDownAlertRef.alertWithType(
|
||||||
'error',
|
'error',
|
||||||
I18n.t('ERROR_LABEL'),
|
I18n.t('ERROR_LABEL'),
|
||||||
Utils.getErrorMsg(insurancePrimeAmount),
|
Utils.getErrorMsg(insurancePrimeAmount),
|
||||||
);
|
);
|
||||||
dispatch(fetchGetInsurancePrimeAmountReset());
|
dispatch(fetchGetInsurancePrimeAmountReset());*/
|
||||||
}
|
}
|
||||||
}, [insurancePrimeAmount]);
|
}, [insurancePrimeAmount]);
|
||||||
|
|
||||||
|
@ -352,11 +389,22 @@ const InsuranceSubscriptionScreen = ({
|
||||||
|
|
||||||
if (insurance !== null) {
|
if (insurance !== null) {
|
||||||
if (beneficiaries.length === parseInt(insurance.max_number_of_beneficiaries)) {
|
if (beneficiaries.length === parseInt(insurance.max_number_of_beneficiaries)) {
|
||||||
dropDownAlertRef.alertWithType(
|
Alert.alert(
|
||||||
|
I18n.t("ERROR_LABLE"),
|
||||||
|
I18n.t("NUMBER_MAX_BENEFICIARY"),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
);
|
||||||
|
/* dropDownAlertRef.alertWithType(
|
||||||
'error',
|
'error',
|
||||||
I18n.t('ERROR_LABEL'),
|
I18n.t('ERROR_LABEL'),
|
||||||
I18n.t('NUMBER_MAX_BENEFICIARY'),
|
I18n.t('NUMBER_MAX_BENEFICIARY'),
|
||||||
);
|
);*/
|
||||||
} else {
|
} else {
|
||||||
console.log("affiliation", affiliation);
|
console.log("affiliation", affiliation);
|
||||||
let beneficiariesTemp = beneficiaries;
|
let beneficiariesTemp = beneficiaries;
|
||||||
|
@ -385,12 +433,24 @@ const InsuranceSubscriptionScreen = ({
|
||||||
}
|
}
|
||||||
|
|
||||||
if (uploadInsuranceImages.error) {
|
if (uploadInsuranceImages.error) {
|
||||||
dropDownAlertRef.alertWithType(
|
Alert.alert(
|
||||||
|
I18n.t("ERROR_LABLE"),
|
||||||
|
Utils.getErrorMsg(uploadInsuranceImages),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
dispatch(fetchUploadInsuranceReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
);
|
||||||
|
/* dropDownAlertRef.alertWithType(
|
||||||
'error',
|
'error',
|
||||||
I18n.t('ERROR_LABEL'),
|
I18n.t('ERROR_LABEL'),
|
||||||
Utils.getErrorMsg(uploadInsuranceImages),
|
Utils.getErrorMsg(uploadInsuranceImages),
|
||||||
);
|
);
|
||||||
dispatch(fetchUploadInsuranceReset());
|
dispatch(fetchUploadInsuranceReset());*/
|
||||||
}
|
}
|
||||||
}, [uploadInsuranceImages]);
|
}, [uploadInsuranceImages]);
|
||||||
|
|
||||||
|
@ -1170,11 +1230,23 @@ const InsuranceSubscriptionScreen = ({
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
if (insurance === null) {
|
if (insurance === null) {
|
||||||
dropDownAlertRef.alertWithType(
|
Alert.alert(
|
||||||
|
I18n.t("ERROR_LABLE"),
|
||||||
|
I18n.t("PLEASE_SELECT_INSURANCE_BEFORE"),
|
||||||
|
Utils.getErrorMsg(uploadInsuranceImages),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
);
|
||||||
|
/* dropDownAlertRef.alertWithType(
|
||||||
'error',
|
'error',
|
||||||
I18n.t('ERROR_LABEL'),
|
I18n.t('ERROR_LABEL'),
|
||||||
I18n.t('PLEASE_SELECT_INSURANCE_BEFORE'),
|
I18n.t('PLEASE_SELECT_INSURANCE_BEFORE'),
|
||||||
);
|
);*/
|
||||||
} else {
|
} else {
|
||||||
setModalVisible(true);
|
setModalVisible(true);
|
||||||
setShowDateNaissancePicker(false);
|
setShowDateNaissancePicker(false);
|
||||||
|
|
|
@ -0,0 +1,410 @@
|
||||||
|
import React, {useEffect, useState} from 'react';
|
||||||
|
import {Alert, Dimensions, KeyboardAvoidingView, Platform, ScrollView, StyleSheet, View,} from 'react-native';
|
||||||
|
import {connect, useDispatch} from 'react-redux';
|
||||||
|
import {Formik} from 'formik';
|
||||||
|
import * as Yup from 'yup';
|
||||||
|
import * as Utils from '../../../utils/UtilsFunction';
|
||||||
|
import {Color} from "../../../config/Color";
|
||||||
|
import I18n from 'react-native-i18n';
|
||||||
|
import {ScreenComponent} from "../../../components/ScreenComponent";
|
||||||
|
import PasswordInput from '../../../components/PasswordInput';
|
||||||
|
import Button from "../../../components/Button";
|
||||||
|
import FontAwesome from "react-native-vector-icons/FontAwesome";
|
||||||
|
import {responsiveWidth} from "react-native-responsive-dimensions";
|
||||||
|
import {
|
||||||
|
fetchStopSubscription,
|
||||||
|
fetchStopSubscriptionReset,
|
||||||
|
fetchGetSubscriptionList,
|
||||||
|
fetchGetSubscriptionListReset,
|
||||||
|
fetchGetListInsuranceReset,
|
||||||
|
fetchGetListInsuranceWithBeneficiaries,
|
||||||
|
fetchRenewSubscription, fetchUploadInsuranceReset
|
||||||
|
} from "../../../redux/insurance/insurance.actions";
|
||||||
|
import DropdownAlert from "react-native-dropdownalert";
|
||||||
|
import {readUser} from "../../../webservice/AuthApi";
|
||||||
|
import * as Animatable from 'react-native-animatable';
|
||||||
|
import {createStructuredSelector} from "reselect";
|
||||||
|
import {
|
||||||
|
selectInsuranceList,
|
||||||
|
selectStopSubscription,
|
||||||
|
selectSubscriptionList
|
||||||
|
} from "../../../redux/insurance/insurance.selector";
|
||||||
|
|
||||||
|
import {Dropdown} from "react-native-material-dropdown";
|
||||||
|
|
||||||
|
let moment = require('moment-timezone');
|
||||||
|
|
||||||
|
const {width, height} = Dimensions.get('window');
|
||||||
|
const CIRCLE_SIZE = width * 0.5;
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
textInput: {
|
||||||
|
height: 46,
|
||||||
|
backgroundColor: Color.fieldColor,
|
||||||
|
borderRadius: 5,
|
||||||
|
marginTop: 10,
|
||||||
|
padding: 10,
|
||||||
|
width: '100%',
|
||||||
|
},
|
||||||
|
lineRow: {
|
||||||
|
flexDirection: 'row',
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
paddingBottom: 20,
|
||||||
|
},
|
||||||
|
contain: {
|
||||||
|
alignItems: 'center',
|
||||||
|
marginTop: 40,
|
||||||
|
paddingBottom: 20,
|
||||||
|
paddingLeft: 20,
|
||||||
|
paddingRight: 20,
|
||||||
|
flex: 1,
|
||||||
|
},
|
||||||
|
circle: {
|
||||||
|
width: CIRCLE_SIZE,
|
||||||
|
height: CIRCLE_SIZE,
|
||||||
|
borderRadius: CIRCLE_SIZE / 2,
|
||||||
|
position: 'absolute',
|
||||||
|
top: '15%',
|
||||||
|
},
|
||||||
|
circleContainer: {
|
||||||
|
alignItems: 'flex-end',
|
||||||
|
right: -(CIRCLE_SIZE / 3),
|
||||||
|
top: -(CIRCLE_SIZE / 1.5),
|
||||||
|
},
|
||||||
|
lineSeparator: {
|
||||||
|
borderWidth: 1,
|
||||||
|
width: '40%',
|
||||||
|
height: 1,
|
||||||
|
alignSelf: 'center',
|
||||||
|
},
|
||||||
|
line: {
|
||||||
|
width: 1,
|
||||||
|
height: 14,
|
||||||
|
backgroundColor: Color.grayColor,
|
||||||
|
marginLeft: 10,
|
||||||
|
},
|
||||||
|
contentModeView: {
|
||||||
|
width: 30,
|
||||||
|
height: '100%',
|
||||||
|
alignItems: 'flex-end',
|
||||||
|
justifyContent: 'center',
|
||||||
|
},
|
||||||
|
contentFilter: {
|
||||||
|
flexDirection: 'row',
|
||||||
|
alignItems: 'center',
|
||||||
|
marginLeft: 10,
|
||||||
|
},
|
||||||
|
bottomModal: {
|
||||||
|
justifyContent: 'flex-end',
|
||||||
|
margin: 0,
|
||||||
|
},
|
||||||
|
contentFilterBottom: {
|
||||||
|
width: "100%",
|
||||||
|
borderTopLeftRadius: 8,
|
||||||
|
borderTopRightRadius: 8,
|
||||||
|
paddingHorizontal: 20
|
||||||
|
},
|
||||||
|
contentSwipeDown: {
|
||||||
|
paddingTop: 10,
|
||||||
|
alignItems: 'center',
|
||||||
|
},
|
||||||
|
lineSwipeDown: {
|
||||||
|
width: 30,
|
||||||
|
height: 2.5,
|
||||||
|
backgroundColor: Color.dividerColor,
|
||||||
|
},
|
||||||
|
contentActionModalBottom: {
|
||||||
|
flexDirection: 'row',
|
||||||
|
paddingVertical: 15,
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
borderBottomWidth: 1,
|
||||||
|
},
|
||||||
|
containModal: {
|
||||||
|
paddingVertical: 10,
|
||||||
|
paddingHorizontal: 20,
|
||||||
|
flexDirection: 'row',
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
},
|
||||||
|
floatingButtonAdd: {
|
||||||
|
backgroundColor: Color.accentColor,
|
||||||
|
position: "absolute",
|
||||||
|
width: 25,
|
||||||
|
bottom: 0,
|
||||||
|
zIndex: 1000,
|
||||||
|
right: 20,
|
||||||
|
top: 35,
|
||||||
|
height: 25,
|
||||||
|
borderRadius: 12.5,
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
},
|
||||||
|
contentSwitch: {
|
||||||
|
width: responsiveWidth(40),
|
||||||
|
},
|
||||||
|
switch: {},
|
||||||
|
choosePhotoBtn: {
|
||||||
|
marginTop: 10,
|
||||||
|
marginBottom: 10,
|
||||||
|
width: "auto",
|
||||||
|
height: "auto",
|
||||||
|
padding: 5,
|
||||||
|
alignItems: 'center',
|
||||||
|
borderColor: Color.borderColor,
|
||||||
|
marginRight: 10,
|
||||||
|
elevation: 2,
|
||||||
|
},
|
||||||
|
checkbox: {
|
||||||
|
alignSelf: "center",
|
||||||
|
color: "white"
|
||||||
|
},
|
||||||
|
itemAmountPerMonth: {
|
||||||
|
paddingLeft: 10,
|
||||||
|
marginTop: 10,
|
||||||
|
flexDirection: 'row',
|
||||||
|
},
|
||||||
|
dot: {
|
||||||
|
width: 12,
|
||||||
|
height: 12,
|
||||||
|
borderRadius: 6
|
||||||
|
},
|
||||||
|
blockView: {
|
||||||
|
paddingVertical: 10,
|
||||||
|
borderBottomWidth: 0.5,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const RenewAssuranceScreen = ({
|
||||||
|
stopSubscription,
|
||||||
|
fetchGetSubscriptionList,
|
||||||
|
fetchGetListInsuranceWithBeneficiaries,
|
||||||
|
insuranceList,
|
||||||
|
fetchRenewSubscription,
|
||||||
|
navigation
|
||||||
|
}) => {
|
||||||
|
|
||||||
|
const [user, setUser] = useState(null);
|
||||||
|
const [password, setPassword] = useState(null);
|
||||||
|
const [subscriptions, setSubscriptions] = useState([]);
|
||||||
|
const [subscription, setSubscription] = useState(null);
|
||||||
|
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
let dropDownAlertRef: any = null;
|
||||||
|
let subscriptionRef = null;
|
||||||
|
let amountPerMonthRef = null;
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
readUser().then((user) => {
|
||||||
|
setUser(user)
|
||||||
|
});
|
||||||
|
dispatch(fetchGetListInsuranceReset());
|
||||||
|
dispatch(fetchGetSubscriptionListReset());
|
||||||
|
dispatch(fetchStopSubscriptionReset());
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (user !== null) {
|
||||||
|
console.log("user", user.id);
|
||||||
|
fetchGetListInsuranceWithBeneficiaries(`?user_id=${user.id}&type=STOPPED`);
|
||||||
|
//fetchGetSubscriptionList(user.id, 'ACCEPTED', true);
|
||||||
|
}
|
||||||
|
}, [user]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (insuranceList.result !== null) {
|
||||||
|
let insuranceListTemp = [];
|
||||||
|
insuranceList.result.response.map((subscriptionItem, index) => {
|
||||||
|
insuranceListTemp.push(subscriptionItem);
|
||||||
|
});
|
||||||
|
setSubscriptions(insuranceListTemp);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (insuranceList.error) {
|
||||||
|
Alert.alert(
|
||||||
|
I18n.t("ERROR_LABLE"),
|
||||||
|
Utils.getErrorMsg(insuranceList),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
dispatch(fetchGetSubscriptionListReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
);
|
||||||
|
/* dropDownAlertRef.alertWithType(
|
||||||
|
'error',
|
||||||
|
I18n.t('ERROR_LABEL'),
|
||||||
|
Utils.getErrorMsg(insuranceList),
|
||||||
|
);
|
||||||
|
dispatch(fetchGetSubscriptionListReset());*/
|
||||||
|
}
|
||||||
|
}, [insuranceList]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (stopSubscription.result !== null) {
|
||||||
|
Alert.alert(
|
||||||
|
I18n.t("SUCCESS"),
|
||||||
|
stopSubscription.result.response,
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
dispatch(fetchStopSubscriptionReset());
|
||||||
|
navigation.goBack();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
],
|
||||||
|
{cancelable: false}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (stopSubscription.error) {
|
||||||
|
Alert.alert(
|
||||||
|
I18n.t("ERROR_LABLE"),
|
||||||
|
Utils.getErrorMsg(stopSubscription),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
dispatch(fetchStopSubscriptionReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
);
|
||||||
|
/* dropDownAlertRef.alertWithType(
|
||||||
|
'error',
|
||||||
|
I18n.t('ERROR_LABEL'),
|
||||||
|
Utils.getErrorMsg(stopSubscription),
|
||||||
|
);
|
||||||
|
dispatch(fetchStopSubscriptionReset());*/
|
||||||
|
}
|
||||||
|
}, [stopSubscription]);
|
||||||
|
|
||||||
|
const RegisterSchema = Yup.object().shape({
|
||||||
|
password: Yup.string()
|
||||||
|
.required(I18n.t('THIS_FIELD_IS_REQUIRED'))
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ScreenComponent>
|
||||||
|
<DropdownAlert ref={ref => (dropDownAlertRef = ref)}/>
|
||||||
|
<KeyboardAvoidingView
|
||||||
|
behavior={Platform.OS === 'android' ? 'height' : 'padding'}
|
||||||
|
style={{flex: 1}}>
|
||||||
|
|
||||||
|
<ScrollView style={{flex: 1}}>
|
||||||
|
<Formik validationSchema={RegisterSchema}
|
||||||
|
initialValues={{
|
||||||
|
password: '',
|
||||||
|
}}
|
||||||
|
onSubmit={(values) => {
|
||||||
|
if (user !== null) {
|
||||||
|
if (subscription === null) {
|
||||||
|
subscriptionRef.shake(800);
|
||||||
|
} else {
|
||||||
|
console.log("subscription", subscription);
|
||||||
|
fetchRenewSubscription(subscription.id, {password: values.password});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}}>
|
||||||
|
|
||||||
|
{({
|
||||||
|
values,
|
||||||
|
errors,
|
||||||
|
touched,
|
||||||
|
handleChange,
|
||||||
|
handleBlur,
|
||||||
|
handleSubmit,
|
||||||
|
isSubmitting,
|
||||||
|
}) => (
|
||||||
|
<View style={styles.contain}>
|
||||||
|
<Animatable.View ref={(comp) => {
|
||||||
|
subscriptionRef = comp
|
||||||
|
}}
|
||||||
|
style={{
|
||||||
|
width: responsiveWidth(90),
|
||||||
|
height: 60,
|
||||||
|
alignSelf: 'center',
|
||||||
|
borderRadius: 10,
|
||||||
|
paddingLeft: 20,
|
||||||
|
paddingRight: 20,
|
||||||
|
backgroundColor: 'white'
|
||||||
|
}}>
|
||||||
|
<Dropdown
|
||||||
|
label={I18n.t('SELECT_INSURANCE')}
|
||||||
|
data={subscriptions}
|
||||||
|
useNativeDriver={true}
|
||||||
|
onChangeText={(value, index, data) => {
|
||||||
|
console.log("Value", value);
|
||||||
|
setSubscription(
|
||||||
|
{
|
||||||
|
id: value.id,
|
||||||
|
insurance_subscription_id: value.insurance_subscription_id,
|
||||||
|
network_id: value.network_id,
|
||||||
|
user_id: value.user_id,
|
||||||
|
number_of_months: value.number_of_months,
|
||||||
|
bonus_amount: value.bonus_amount,
|
||||||
|
number_of_beneficiaries: value.number_of_beneficiaries,
|
||||||
|
total_bonus_amount: value.total_bonus_amount,
|
||||||
|
state: value.state,
|
||||||
|
created_at: value.created_at,
|
||||||
|
updated_at: value.updated_at,
|
||||||
|
start_at: value.start_at,
|
||||||
|
end_at: value.end_at,
|
||||||
|
reason: value.reason,
|
||||||
|
network: value.network,
|
||||||
|
beneficiaries: value.beneficiaries
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
valueExtractor={(value) => {
|
||||||
|
return value
|
||||||
|
}}
|
||||||
|
labelExtractor={(value) => {
|
||||||
|
return `${value.network.name} | ${I18n.t('ETAT')}: ${value.state} | ${I18n.t('AMOUNT_LABEL')}: ${value.total_bonus_amount}`
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Animatable.View>
|
||||||
|
|
||||||
|
<PasswordInput
|
||||||
|
style={{marginTop: 10}}
|
||||||
|
onChangeText={handleChange('password')}
|
||||||
|
placeholder={I18n.t('PASSWORD')}
|
||||||
|
secureTextEntry
|
||||||
|
icon={<FontAwesome name="lock" size={20}/>}
|
||||||
|
value={values.password}
|
||||||
|
onBlur={handleBlur('password')}
|
||||||
|
success={touched.password && !errors.password}
|
||||||
|
touched={touched.password}
|
||||||
|
error={errors.password}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
style={{marginTop: 20}}
|
||||||
|
full
|
||||||
|
loading={stopSubscription.loading}
|
||||||
|
onPress={handleSubmit}>
|
||||||
|
{I18n.t('SUBMIT_LABEL')}
|
||||||
|
</Button>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
</Formik>
|
||||||
|
|
||||||
|
</ScrollView>
|
||||||
|
</KeyboardAvoidingView>
|
||||||
|
</ScreenComponent>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const mapStateToProps = createStructuredSelector({
|
||||||
|
insuranceList: selectInsuranceList,
|
||||||
|
stopSubscription: selectStopSubscription
|
||||||
|
});
|
||||||
|
|
||||||
|
export default connect(mapStateToProps, {
|
||||||
|
fetchRenewSubscription,
|
||||||
|
fetchGetListInsuranceWithBeneficiaries,
|
||||||
|
fetchGetSubscriptionList,
|
||||||
|
})(
|
||||||
|
RenewAssuranceScreen,
|
||||||
|
);
|
|
@ -15,13 +15,17 @@ import {
|
||||||
fetchStopSubscription,
|
fetchStopSubscription,
|
||||||
fetchStopSubscriptionReset,
|
fetchStopSubscriptionReset,
|
||||||
fetchGetSubscriptionList,
|
fetchGetSubscriptionList,
|
||||||
fetchGetSubscriptionListReset
|
fetchGetSubscriptionListReset, fetchGetListInsuranceReset, fetchGetListInsuranceWithBeneficiaries
|
||||||
} from "../../../redux/insurance/insurance.actions";
|
} from "../../../redux/insurance/insurance.actions";
|
||||||
import DropdownAlert from "react-native-dropdownalert";
|
import DropdownAlert from "react-native-dropdownalert";
|
||||||
import {readUser} from "../../../webservice/AuthApi";
|
import {readUser} from "../../../webservice/AuthApi";
|
||||||
import * as Animatable from 'react-native-animatable';
|
import * as Animatable from 'react-native-animatable';
|
||||||
import {createStructuredSelector} from "reselect";
|
import {createStructuredSelector} from "reselect";
|
||||||
import {selectStopSubscription, selectSubscriptionList} from "../../../redux/insurance/insurance.selector";
|
import {
|
||||||
|
selectInsuranceList,
|
||||||
|
selectStopSubscription,
|
||||||
|
selectSubscriptionList
|
||||||
|
} from "../../../redux/insurance/insurance.selector";
|
||||||
|
|
||||||
import {Dropdown} from "react-native-material-dropdown";
|
import {Dropdown} from "react-native-material-dropdown";
|
||||||
|
|
||||||
|
@ -169,7 +173,8 @@ const styles = StyleSheet.create({
|
||||||
const StopSubscriptionScreen = ({
|
const StopSubscriptionScreen = ({
|
||||||
stopSubscription,
|
stopSubscription,
|
||||||
fetchGetSubscriptionList,
|
fetchGetSubscriptionList,
|
||||||
subscriptionList,
|
fetchGetListInsuranceWithBeneficiaries,
|
||||||
|
insuranceList,
|
||||||
fetchStopSubscription,
|
fetchStopSubscription,
|
||||||
navigation
|
navigation
|
||||||
}) => {
|
}) => {
|
||||||
|
@ -188,6 +193,7 @@ const StopSubscriptionScreen = ({
|
||||||
readUser().then((user) => {
|
readUser().then((user) => {
|
||||||
setUser(user)
|
setUser(user)
|
||||||
});
|
});
|
||||||
|
dispatch(fetchGetListInsuranceReset());
|
||||||
dispatch(fetchGetSubscriptionListReset());
|
dispatch(fetchGetSubscriptionListReset());
|
||||||
dispatch(fetchStopSubscriptionReset());
|
dispatch(fetchStopSubscriptionReset());
|
||||||
}, []);
|
}, []);
|
||||||
|
@ -195,28 +201,41 @@ const StopSubscriptionScreen = ({
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (user !== null) {
|
if (user !== null) {
|
||||||
console.log("user", user.id);
|
console.log("user", user.id);
|
||||||
fetchGetSubscriptionList(user.id, 'ACCEPTED', true);
|
fetchGetListInsuranceWithBeneficiaries(`?user_id=${user.id}&type=EDITABLE`);
|
||||||
|
//fetchGetSubscriptionList(user.id, 'ACCEPTED', true);
|
||||||
}
|
}
|
||||||
}, [user]);
|
}, [user]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (subscriptionList.result !== null) {
|
if (insuranceList.result !== null) {
|
||||||
let subscriptionListTemp = [];
|
let insuranceListTemp = [];
|
||||||
subscriptionList.result.response.map((subscriptionItem, index) => {
|
insuranceList.result.response.map((subscriptionItem, index) => {
|
||||||
subscriptionListTemp.push(subscriptionItem);
|
insuranceListTemp.push(subscriptionItem);
|
||||||
});
|
});
|
||||||
setSubscriptions(subscriptionListTemp);
|
setSubscriptions(insuranceListTemp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (subscriptionList.error) {
|
if (insuranceList.error) {
|
||||||
dropDownAlertRef.alertWithType(
|
Alert.alert(
|
||||||
|
I18n.t("ERROR_LABLE"),
|
||||||
|
Utils.getErrorMsg(insuranceList),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
dispatch(fetchGetSubscriptionListReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
);
|
||||||
|
/* dropDownAlertRef.alertWithType(
|
||||||
'error',
|
'error',
|
||||||
I18n.t('ERROR_LABEL'),
|
I18n.t('ERROR_LABEL'),
|
||||||
Utils.getErrorMsg(subscriptionList),
|
Utils.getErrorMsg(insuranceList),
|
||||||
);
|
);
|
||||||
dispatch(fetchGetSubscriptionListReset());
|
dispatch(fetchGetSubscriptionListReset());*/
|
||||||
}
|
}
|
||||||
}, [subscriptionList]);
|
}, [insuranceList]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (stopSubscription.result !== null) {
|
if (stopSubscription.result !== null) {
|
||||||
|
@ -237,12 +256,24 @@ const StopSubscriptionScreen = ({
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stopSubscription.error) {
|
if (stopSubscription.error) {
|
||||||
dropDownAlertRef.alertWithType(
|
Alert.alert(
|
||||||
|
I18n.t("ERROR_LABLE"),
|
||||||
|
Utils.getErrorMsg(stopSubscription),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
dispatch(fetchStopSubscriptionReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
);
|
||||||
|
/* dropDownAlertRef.alertWithType(
|
||||||
'error',
|
'error',
|
||||||
I18n.t('ERROR_LABEL'),
|
I18n.t('ERROR_LABEL'),
|
||||||
Utils.getErrorMsg(stopSubscription),
|
Utils.getErrorMsg(stopSubscription),
|
||||||
);
|
);
|
||||||
dispatch(fetchStopSubscriptionReset());
|
dispatch(fetchStopSubscriptionReset());*/
|
||||||
}
|
}
|
||||||
}, [stopSubscription]);
|
}, [stopSubscription]);
|
||||||
|
|
||||||
|
@ -363,12 +394,13 @@ const StopSubscriptionScreen = ({
|
||||||
};
|
};
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
subscriptionList: selectSubscriptionList,
|
insuranceList: selectInsuranceList,
|
||||||
stopSubscription: selectStopSubscription
|
stopSubscription: selectStopSubscription
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(mapStateToProps, {
|
export default connect(mapStateToProps, {
|
||||||
fetchStopSubscription,
|
fetchStopSubscription,
|
||||||
|
fetchGetListInsuranceWithBeneficiaries,
|
||||||
fetchGetSubscriptionList,
|
fetchGetSubscriptionList,
|
||||||
})(
|
})(
|
||||||
StopSubscriptionScreen,
|
StopSubscriptionScreen,
|
||||||
|
|
|
@ -23,7 +23,7 @@ import {
|
||||||
fetchAcceptRejectConsultation,
|
fetchAcceptRejectConsultation,
|
||||||
fetchAcceptRejectConsultationReset,
|
fetchAcceptRejectConsultationReset,
|
||||||
fetchActivePaySubscription,
|
fetchActivePaySubscription,
|
||||||
fetchGetConsultation
|
fetchGetConsultation, fetchStopSubscriptionReset
|
||||||
} from "../../../redux/insurance/insurance.actions";
|
} from "../../../redux/insurance/insurance.actions";
|
||||||
import * as Utils from "../../../utils/UtilsFunction";
|
import * as Utils from "../../../utils/UtilsFunction";
|
||||||
import {uppercaseFirstLetter} from "../../../utils/UtilsFunction";
|
import {uppercaseFirstLetter} from "../../../utils/UtilsFunction";
|
||||||
|
@ -65,12 +65,24 @@ const ValidateConsultationDetailScreen = ({navigation, fetchAcceptRejectConsulta
|
||||||
}
|
}
|
||||||
|
|
||||||
if (acceptRefuseConsultation.error) {
|
if (acceptRefuseConsultation.error) {
|
||||||
dropDownAlertRef.alertWithType(
|
Alert.alert(
|
||||||
|
I18n.t("ERROR_LABLE"),
|
||||||
|
Utils.getErrorMsg(acceptRefuseConsultation),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
dispatch(fetchAcceptRejectConsultationReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
);
|
||||||
|
/* dropDownAlertRef.alertWithType(
|
||||||
'error',
|
'error',
|
||||||
I18n.t('ERROR_LABEL'),
|
I18n.t('ERROR_LABEL'),
|
||||||
Utils.getErrorMsg(acceptRefuseConsultation),
|
Utils.getErrorMsg(acceptRefuseConsultation),
|
||||||
);
|
);
|
||||||
dispatch(fetchAcceptRejectConsultationReset());
|
dispatch(fetchAcceptRejectConsultationReset());*/
|
||||||
}
|
}
|
||||||
}, [acceptRefuseConsultation]);
|
}, [acceptRefuseConsultation]);
|
||||||
|
|
||||||
|
|
|
@ -75,12 +75,24 @@ const ValidateConsultationScreen = ({
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (getConsultation.error) {
|
if (getConsultation.error) {
|
||||||
dropDownAlertRef.alertWithType(
|
Alert.alert(
|
||||||
|
I18n.t("ERROR_LABLE"),
|
||||||
|
Utils.getErrorMsg(getConsultation),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
dispatch(fetchGetConsultationReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
);
|
||||||
|
/* dropDownAlertRef.alertWithType(
|
||||||
'error',
|
'error',
|
||||||
I18n.t('ERROR_LABEL'),
|
I18n.t('ERROR_LABEL'),
|
||||||
Utils.getErrorMsg(getConsultation),
|
Utils.getErrorMsg(getConsultation),
|
||||||
);
|
);
|
||||||
dispatch(fetchGetConsultationReset());
|
dispatch(fetchGetConsultationReset());*/
|
||||||
}
|
}
|
||||||
}, [getConsultation]);
|
}, [getConsultation]);
|
||||||
|
|
||||||
|
@ -106,12 +118,24 @@ const ValidateConsultationScreen = ({
|
||||||
}
|
}
|
||||||
|
|
||||||
if (acceptRefuseConsultation.error) {
|
if (acceptRefuseConsultation.error) {
|
||||||
dropDownAlertRef.alertWithType(
|
Alert.alert(
|
||||||
|
I18n.t("ERROR_LABLE"),
|
||||||
|
Utils.getErrorMsg(acceptRefuseConsultation),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
dispatch(fetchAcceptRejectConsultationReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
);
|
||||||
|
/* dropDownAlertRef.alertWithType(
|
||||||
'error',
|
'error',
|
||||||
I18n.t('ERROR_LABEL'),
|
I18n.t('ERROR_LABEL'),
|
||||||
Utils.getErrorMsg(acceptRefuseConsultation),
|
Utils.getErrorMsg(acceptRefuseConsultation),
|
||||||
);
|
);
|
||||||
dispatch(fetchAcceptRejectConsultationReset());
|
dispatch(fetchAcceptRejectConsultationReset());*/
|
||||||
setDisplayModalHistory(false);
|
setDisplayModalHistory(false);
|
||||||
if (user !== null)
|
if (user !== null)
|
||||||
fetchGetConsultation(user.id, 'UNTREATED');
|
fetchGetConsultation(user.id, 'UNTREATED');
|
||||||
|
|
|
@ -503,7 +503,7 @@ export const optionNanoSanteUserScreen = {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'RENEW_INSSURANCE',
|
title: 'RENEW_INSSURANCE',
|
||||||
screen: '',
|
screen: 'renewAssuranceScreen',
|
||||||
icon: "cash-refund"
|
icon: "cash-refund"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue