exit resoved
This commit is contained in:
@@ -221,15 +221,6 @@ const Exit = ({ isOpen, onClose }) => {
|
||||
),
|
||||
}));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const Total = () => {
|
||||
return (
|
||||
<Table size="sm">
|
||||
@@ -352,25 +343,26 @@ const Exit = ({ isOpen, onClose }) => {
|
||||
};
|
||||
|
||||
const onFinalSubmit = async (data) => {
|
||||
console.log("hit");
|
||||
setIsFinalCalculateLoading(true);
|
||||
if (!isCalcualtedData) {
|
||||
setIsFinalCalculateLoading(false);
|
||||
return toast({
|
||||
render: () => (
|
||||
<ToastBox
|
||||
message={"Please calculate investment first."}
|
||||
status="warn"
|
||||
/>
|
||||
),
|
||||
});
|
||||
}
|
||||
// if (!isCalcualtedData) {
|
||||
// setIsFinalCalculateLoading(false);
|
||||
// return toast({
|
||||
// render: () => (
|
||||
// <ToastBox
|
||||
// message={"Please calculate investment first."}
|
||||
// status="warn"
|
||||
// />
|
||||
// ),
|
||||
// });
|
||||
// }
|
||||
|
||||
const finalData = {
|
||||
transactionAmount: data?.amount,
|
||||
transactionAmount: IODetails?.ioMVNAV,
|
||||
};
|
||||
|
||||
try {
|
||||
const res = await updateExitToInvestor({ id, data: finalData })
|
||||
const res = await updateExitToInvestor({ id, data: finalData });
|
||||
console.log(finalData);
|
||||
|
||||
if (res?.error?.status === 401) {
|
||||
@@ -414,23 +406,34 @@ const Exit = ({ isOpen, onClose }) => {
|
||||
<FormLabel textAlign={"right"} fontSize={"sm"}>
|
||||
Enter Exit Amount
|
||||
</FormLabel> */}
|
||||
<Text textAlign={'start'} bg={'green.100'} p={2} rounded={'md'} fontSize={"sm"} pt={1} pb={1} fontWeight={600}>$ {parseFloat(IODetails?.ioMVNAV || 0).toLocaleString(undefined, {
|
||||
minimumFractionDigits: 2,
|
||||
maximumFractionDigits: 2,
|
||||
})}</Text>
|
||||
<Text
|
||||
textAlign={"start"}
|
||||
bg={"green.100"}
|
||||
p={2}
|
||||
rounded={"md"}
|
||||
fontSize={"sm"}
|
||||
pt={1}
|
||||
pb={1}
|
||||
fontWeight={600}
|
||||
>
|
||||
${" "}
|
||||
{parseFloat(IODetails?.ioMVNAV || 0).toLocaleString(undefined, {
|
||||
minimumFractionDigits: 2,
|
||||
maximumFractionDigits: 2,
|
||||
})}
|
||||
</Text>
|
||||
|
||||
|
||||
{/* </FormControl> */}
|
||||
</HStack>
|
||||
|
||||
{/* {calcualtedData && ( */}
|
||||
<NormalData
|
||||
emptyMessage={`We don't have any Sponers `}
|
||||
tableHeadRow={tableHeadRow}
|
||||
data={extractedArray}
|
||||
// total={<Total />}
|
||||
// isLoading={isLoading}
|
||||
/>
|
||||
<NormalData
|
||||
emptyMessage={`We don't have any Sponers `}
|
||||
tableHeadRow={tableHeadRow}
|
||||
data={extractedArray}
|
||||
// total={<Total />}
|
||||
// isLoading={isLoading}
|
||||
/>
|
||||
{/* ) } */}
|
||||
</ModalBody>
|
||||
<ModalFooter pt={0}>
|
||||
@@ -445,7 +448,7 @@ const Exit = ({ isOpen, onClose }) => {
|
||||
}}
|
||||
size={"sm"}
|
||||
rounded={"sm"}
|
||||
onClick={handleSubmit(onFinalSubmit)}
|
||||
onClick={() => onFinalSubmit()}
|
||||
isLoading={isFinalCalculateLoading}
|
||||
>
|
||||
Save
|
||||
|
||||
Reference in New Issue
Block a user