This commit is contained in:
YasinShaikh123
2024-11-14 17:39:08 +05:30
parent b518e5fb8b
commit 28f84b178a
3 changed files with 9 additions and 3 deletions

View File

@@ -90,9 +90,9 @@ const AddCashDetails = ({ isOpen, onClose, firstField, actionId, setActionId, da
toast({
render: () => <ToastBox message={res?.error?.data?.message } status={"error"} />,
});
setAlert(false);
}
} catch (error) {
console.log(error);

View File

@@ -152,7 +152,7 @@ const IOArtifactsAdd = ({ isOpen, onClose, firstField, actionId, setActionId, da
<DrawerBody>
<Stack spacing={4}>
<FormControl isInvalid={errors.artifactName}>
<FormControl isInvalid={errors.artifactName} isRequired={true}>
<FormLabel fontSize={"sm"}>Artifact Name</FormLabel>
<Controller
name="artifactName"
@@ -166,7 +166,7 @@ const IOArtifactsAdd = ({ isOpen, onClose, firstField, actionId, setActionId, da
</FormErrorMessage>
</FormControl>
<FormControl isInvalid={errors.artifactStreamingURL}>
<FormControl isInvalid={errors.artifactStreamingURL} isRequired={true}>
<FormLabel fontSize={"sm"}>Artifact Streaming URL</FormLabel>
<Controller
name="artifactStreamingURL"

View File

@@ -74,6 +74,11 @@ const DistributionInvestor = ({ isOpen, onClose }) => {
amount: yup
.string()
.required("Amount is required")
.test(
"is-positive",
"Amount should be greater than zero",
(value) => parseFloat(value) > 0 // Check if the amount is greater than zero
)
.test(
"max",
`Distribution amount should not be greater than IO cash amount ${IODetails?.ioCash}`,
@@ -86,6 +91,7 @@ const DistributionInvestor = ({ isOpen, onClose }) => {
}
),
});
const investor = yup.object().shape({
amount: yup.string().required("Amount is required"),