This commit is contained in:
YasinShaikh123
2025-01-07 18:46:00 +05:30
parent d9692c3890
commit 01aece9bf6

View File

@@ -86,7 +86,7 @@ const EditExchangeRate = ({
const [isBtnLoading, setIsBtnLoading] = useState(false);
const [rateError, setRateError] = useState("");
const { data, isLoading, errors } = useGetExchangeRateByIdQuery(id, {
const { data, isLoading, errors,refetch } = useGetExchangeRateByIdQuery(id, {
skip: !id,
});
@@ -99,7 +99,13 @@ const EditExchangeRate = ({
if (foundObject) {
setRate(foundObject.rate);
}
}, [foundObject]);
}, [foundObject, isOpen]);
useEffect(()=>{
if (id) {
refetch()
}
},[isOpen])
const validateRate = async () => {
try {
@@ -222,7 +228,7 @@ const EditExchangeRate = ({
size={"sm"}
value={rate}
onChange={(e) => {
return setRate(e.target.value);
return setRate(e.target.value);
// validateRate()
}}
/>
@@ -241,6 +247,15 @@ const EditExchangeRate = ({
size={"sm"}
mr={3}
onClick={onClose}
// onClick={() => {
// window.location.reload();
// onClose();
// }}
// onClick={() => {
// setRate("");
// setRateError("");
// onClose();
// }}
>
Cancel
</Button>