Compare commits

...

2 Commits

Author SHA1 Message Date
YasinShaikh123
28f84b178a hot fix 2024-11-14 17:39:08 +05:30
YasinShaikh123
b518e5fb8b update add investor 2024-11-14 17:02:01 +05:30
5 changed files with 80 additions and 25 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"),

View File

@@ -223,7 +223,7 @@ const InvestorDetails = () => {
>
{/* {item.KYCStatus ? "Completed" : "Not complete"} */}
{item?.KYCStatus === true ? "Completed" : "NotCompleted"}
{item?.KYCStatus === true ? "Completed" : "Not Completed"}
</Text>
</Box>
),

View File

@@ -107,23 +107,27 @@ const AddInvestmentType = () => {
isActive: isSwitchOn,
};
await updateInvestmentType({ data: formData, id }).then((response) => {
if (response?.data?.statusCode === 200) {
if (response?.data) {
toast({
render: () => <ToastBox message={response?.data?.message} />,
render: () => (
<ToastBox
status={"success"}
message={response?.data?.message}
/>
),
});
setIsLoadingBtn(false);
setAlert(false);
navigate("/investment-type");
} else {
} else if (response?.error) {
toast({
render: () => (
<ToastBox message={"Something Went Wrong"} status={"error"} />
<ToastBox
status={"error"}
message={response?.error?.data?.message}
/>
),
});
setIsLoadingBtn(false);
navigate("/investment-type");
}
});
} catch (error) {
@@ -139,22 +143,50 @@ const AddInvestmentType = () => {
};
await createInvestmentType(formData).then((response) => {
if (response?.data?.statusCode === 201) {
toast({
render: () => <ToastBox message={response?.data?.message} />,
});
// if (response?.data?.statusCode === 201) {
// toast({
// render: () => <ToastBox message={response?.data?.message} />,
// });
setIsLoadingBtn(false);
navigate("/investment-type");
} else {
// setIsLoadingBtn(false);
// navigate("/investment-type");
// } else {
// toast({
// render: () => (
// <ToastBox message={"Something Went Wrong"} status={"error"} />
// ),
// });
// setIsLoadingBtn(false);
// navigate("/investment-type");
// }
if (response?.data) {
toast({
render: () => (
<ToastBox message={"Something Went Wrong"} status={"error"} />
<ToastBox
status={"success"}
message={response?.data?.message}
/>
),
});
setAlert(false);
setIsLoadingBtn(false);
navigate("/investment-type");
} else if (response?.error) {
toast({
render: () => (
<ToastBox
status={"error"}
message={response?.error.data.message}
/>
),
});
setAlert(false);
setIsLoadingBtn(false);
// navigate("/investment-type");
}
});
} catch (error) {
@@ -314,9 +346,22 @@ const AddInvestmentType = () => {
<Box {...OPACITY_ON_LOAD} overflowY={"scroll"} height={"100vh"} pb={14}>
{/* ===================== [Switch Button] ======================== */}
<Box display={"flex"} justifyContent={"space-between"} alignItems={"center"} mt={5} px={4} mb={5}>
<Text fontSize={"sm"} mb={0} onClick={() => navigate(-1)} cursor={"pointer"}>
<ArrowBackIcon fontSize={"xl"} me={2} />Add Details
<Box
display={"flex"}
justifyContent={"space-between"}
alignItems={"center"}
mt={5}
px={4}
mb={5}
>
<Text
fontSize={"sm"}
mb={0}
onClick={() => navigate(-1)}
cursor={"pointer"}
>
<ArrowBackIcon fontSize={"xl"} me={2} />
Add Details
</Text>
<SwitchButton isSwitchOn={isSwitchOn} setIsSwitchOn={setIsSwitchOn} />
</Box>
@@ -338,7 +383,11 @@ const AddInvestmentType = () => {
isOpen={alert}
onClose={() => setAlert(false)}
alertHandler={handleConfirm}
message={id ? "Are you sure you want to update this document?" : " Are you sure you want to add this document?"}
message={
id
? "Are you sure you want to update this document?"
: " Are you sure you want to add this document?"
}
isLoading={isLoadingBtn}
/>
</Box>