@@ -99,7 +104,7 @@ function CompleteConfirmCredit({ onClose, confirmCredit }) {
diff --git a/src/components/MyWallet/Popup/ConfirmNairaWithdraw.jsx b/src/components/MyWallet/Popup/ConfirmNairaWithdraw.jsx
index 0452182..8b392a0 100644
--- a/src/components/MyWallet/Popup/ConfirmNairaWithdraw.jsx
+++ b/src/components/MyWallet/Popup/ConfirmNairaWithdraw.jsx
@@ -22,7 +22,6 @@ function ConfirmNairaWithdraw({
loading: false,
status: false,
});
- let [pageLoading, setPageLoading] = useState(true);
//FUNCTION TO HANDLE SUBMIT
const handleSubmit = () => {
@@ -35,15 +34,17 @@ function ConfirmNairaWithdraw({
if (state?.choice === "prev") {
reqData.recipient_uid = state.details?.recipient_uid;
+ reqData.mode = 100;
}
if (state?.choice === "new") {
- reqData.account_no = state?.accountNumber;
- reqData.account_type = state?.accountType;
- reqData.bank_uid = state?.bank_uid;
- reqData.country = state?.country;
- reqData.state = state?.state;
- reqData.city = state?.city;
+ reqData.account_no = state?.details?.accountNumber;
+ reqData.account_type = Number(state?.details?.accountType);
+ reqData.bank_uid = state?.details?.bank_uid;
+ reqData.country = state?.details?.country;
+ reqData.state = state?.details?.state;
+ reqData.city = state?.details?.city;
+ reqData.mode = 500;
}
apiURL
@@ -64,6 +65,16 @@ function ConfirmNairaWithdraw({
loading: false,
status: false,
});
+ } else if (
+ res.data?.status_message
+ ?.toLowerCase()
+ .includes("recipient_add_error")
+ ) {
+ setRequestStatus({
+ message: res.data?.error,
+ loading: false,
+ status: false,
+ });
} else {
setRequestStatus({
message: "Could not perform transaction",
@@ -105,7 +116,7 @@ function ConfirmNairaWithdraw({
action();
setShowNairaWithdraw({
show: true,
- data: state,
+ data: {},
});
};
@@ -249,7 +260,9 @@ function ConfirmNairaWithdraw({
onClick={state?.choice === "prev" ? getBack : action}
className="border-gradient text-base tracking-wide px-4 py-2 rounded-full"
>
- {state?.choice === "prev" ? "Back" : "Cancel"}
+
+ {state?.choice === "prev" ? "Back" : "Cancel"}
+