From a83b6a3927025134f590b53d5b74031b469f2eca Mon Sep 17 00:00:00 2001 From: hamid zarghami Date: Tue, 31 Dec 2024 16:45:28 +0330 Subject: [PATCH] amount --- src/components/wallet/wallet-address.tsx | 15 ++++++++++++--- src/services/axios/index.ts | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/components/wallet/wallet-address.tsx b/src/components/wallet/wallet-address.tsx index ec4d019..3628c5b 100644 --- a/src/components/wallet/wallet-address.tsx +++ b/src/components/wallet/wallet-address.tsx @@ -21,6 +21,8 @@ export const WalletAddress: FC = ({ pending }) => { mutationFn: sendwithdraw, mutationKey: ["withdraw"] }) + + const [price, setPrice] = useState('') const { handleSubmit, formState: { errors }, control, watch } = useForm({ }) const cardDetail: any = watch("card") @@ -39,13 +41,17 @@ export const WalletAddress: FC = ({ pending }) => { const selectedCard: CardBank | CardBank[] | [] = user?.cardBank?.filter((cardBanks: any) => cardBanks?.IBAN === cardDetail?.id && cardBanks?.PAN === cardDetail?.name) setSelectedCard(selectedCard?.[0]) }, [cardDetail]) + const handleSendWithdraw: SubmitHandler = async () => { + console.log(price); + await mutate({ card: { holderName: selectedCard?.holderName, PAN: selectedCard?.PAN, - IBAN: selectedCard?.IBAN - } + IBAN: selectedCard?.IBAN, + }, + amount: +price }, { onSuccess: (res: any) => { toast.success("درخواست شما با موفقیت ثبت شد") @@ -62,13 +68,16 @@ export const WalletAddress: FC = ({ pending }) => {

ثبت درخواست برداشت از حساب

+ {!pending && ( <> - {/* */} + setPrice(e.target.value)} /> )} />} + + {/* */}
{!pending &&

برای درخواست برداشت از حساب، حساب بانکی مورد نظر خود را انتخاب کنید. پس از انتخاب حساب بانکی، مبلغ مورد نظر خود را وارد کرده و درخواست خود را ثبت کنید. diff --git a/src/services/axios/index.ts b/src/services/axios/index.ts index 14cf52c..44a42e0 100644 --- a/src/services/axios/index.ts +++ b/src/services/axios/index.ts @@ -1,7 +1,7 @@ import axios from "axios"; const axiosInstance = axios.create({ - // baseURL: "http://localhost:7420/api", + // baseURL: "http://192.168.0.243:7420/api", baseURL: "https://asan-service.com/api", });