diff --git a/src/Pages/AccountDeletion/DeletionHistory.jsx b/src/Pages/AccountDeletion/DeletionHistory.jsx
index 530f39b..1108499 100644
--- a/src/Pages/AccountDeletion/DeletionHistory.jsx
+++ b/src/Pages/AccountDeletion/DeletionHistory.jsx
@@ -18,13 +18,13 @@ import CustomAlertDialog from "../../Components/CustomAlertDialog";
import { formatDate } from "../../Components/Functions/UTCConvertor";
import { CheckIcon, CloseIcon } from "@chakra-ui/icons";
import { useGetDeleteHistoryQuery } from "../../Services/delete.request.service";
+import { TABLE_PAGINATION } from "../../Constants/Paginations";
// import { formatDate } from "../../Components/Functions/UTCConvertor";
const DeletionHistory = () => {
const toast = useToast();
const { slideFromRight, setDeleteHistory } =
useContext(GlobalStateContext);
- const [searchTerm, setSearchTerm] = useState("");
const [deleteAlert, setDeleteAlert] = useState(false);
const [actionId, setActionId] = useState(false);
const [mouseEntered, setMouseEntered] = useState(false);
@@ -32,11 +32,35 @@ const DeletionHistory = () => {
+ // =========================== [Use State] =============================
+ const [pageSize, setPageSize] = useState(TABLE_PAGINATION?.size);
+ const [currentPage, setCurrentPage] = useState(TABLE_PAGINATION?.page);
+ const [searchTerm, setSearchTerm] = useState("");
+ const [debouncedSearchTerm, setDebouncedSearchTerm] = useState("");
+
+ // Debounce the search term to avoid making a request on every keystroke
+ useEffect(() => {
+ const handler = setTimeout(() => {
+ setDebouncedSearchTerm(searchTerm);
+ }, 500); // Adjust delay as needed
+ return () => {
+ clearTimeout(handler);
+ };
+ }, [searchTerm]);
+
+
const {
data: deleteHistory,
isLoading,
refetch
- } = useGetDeleteHistoryQuery()
+ } = useGetDeleteHistoryQuery({
+ page: debouncedSearchTerm ? undefined : currentPage, // Omit pagination for search
+ size: debouncedSearchTerm ? undefined : pageSize, // Omit pagination for search
+ search: debouncedSearchTerm,
+ },
+ {
+ skip: debouncedSearchTerm === "" && searchTerm !== "", // Skip if search is empty and it's not the initial request
+ })
const formatDate = (date) => {
return new Date(date).toLocaleDateString('en-GB', {
@@ -51,19 +75,7 @@ const DeletionHistory = () => {
refetch();
}, [refetch]);
-// console.log(deleteHistory?.data);
- // ====================================================[Table Filter]================================================================
- const filteredData = deleteHistory?.data?.rows?.filter((item) => {
- // Filter by name (case insensitive)
- const name = item?.country;
- const searchLower = searchTerm.toLowerCase();
- const nameMatches = name.toLowerCase().includes(searchLower);
-
- return nameMatches;
- });
-
- console.log(deleteHistory);
// ====================================================[Table Setup]================================================================
const tableHeadRow = [
"Sr No.",
@@ -76,7 +88,7 @@ const DeletionHistory = () => {
"Status"
];
- const extractedArray = filteredData?.map((item, index) => ({
+ const extractedArray = deleteHistory?.data?.rows?.map((item, index) => ({
id: item?.id,
"Sr No.": (
new Date(date).toLocaleDateString(); // Simple date formatter
@@ -30,18 +31,12 @@ const BankInvestor = () => {
const thirdField = useRef();
const { bankInvestor, setBankInvestor, slideFromRight } =
useContext(GlobalStateContext);
- const [searchTerm, setSearchTerm] = useState("");
const [isLoading, setIsLoading] = useState(true);
const [deleteAlert, setDeleteAlert] = useState(false);
const [actionId, setActionId] = useState(false);
const [mouseEntered, setMouseEntered] = useState(false);
const [mouseEnteredId, setMouseEnteredId] = useState("");
- const {
- isOpen: isOpen,
- onOpen: onOpen,
- onClose: onClose,
- } = useDisclosure();
-
+ const { isOpen: isOpen, onOpen: onOpen, onClose: onClose } = useDisclosure();
const formatDate = (date) => {
return new Date(date).toLocaleDateString("en-GB", {
@@ -51,15 +46,43 @@ const BankInvestor = () => {
});
};
+ // =========================== [Use State] =============================
+ const [pageSize, setPageSize] = useState(TABLE_PAGINATION?.size);
+ const [currentPage, setCurrentPage] = useState(TABLE_PAGINATION?.page);
+ const [searchTerm, setSearchTerm] = useState("");
+ const [debouncedSearchTerm, setDebouncedSearchTerm] = useState("");
+
+ const [status, setStatus] = useState("");
+ const [kyc, setKyc] = useState("");
+ const [country, setCountry] = useState("");
+
+ // Debounce the search term to avoid making a request on every keystroke
+ useEffect(() => {
+ const handler = setTimeout(() => {
+ setDebouncedSearchTerm(searchTerm);
+ }, 500); // Adjust delay as needed
+ return () => {
+ clearTimeout(handler);
+ };
+ }, [searchTerm]);
- console.log(localStorage.getItem("refreshToken"));
const {
data,
isLoading: unbanLoading,
error,
- refetch
- } = useGetbanInvestorQuery();
-
+ refetch,
+ } = useGetbanInvestorQuery(
+ {
+ page: debouncedSearchTerm ? undefined : currentPage, // Omit pagination for search
+ size: debouncedSearchTerm ? undefined : pageSize, // Omit pagination for search
+ search: debouncedSearchTerm,
+ KYCStatus: kyc,
+ country_xid: country,
+ },
+ {
+ skip: debouncedSearchTerm === "" && searchTerm !== "", // Skip if search is empty and it's not the initial request
+ }
+ );
useEffect(() => {
// Simulate loading
@@ -115,10 +138,7 @@ const BankInvestor = () => {
return nameMatches;
});
-
- console.log(filteredData);
-
- const extractedArray = filteredData?.map((item) => ({
+ const extractedArray = data?.data?.rows?.map((item) => ({
id: item?.id,
"Sr N/O": (
{
{item.id}
),
- "Date": (
+ Date: (
- {formatDate(item?.date)}
+ {formatDate(item?.date)}
),
"Client ID": (
- {item?.clientReference_id}
+ {item?.clientReference_id}
),
"First Name": (
- {item?.firstName}
+ {item?.firstName}
),
"Last Name": (
- {item?.lastName}
+ {item?.lastName}
),
Country: (
- {item?.country}
+ {item?.country}
),
"Phone Number": (
- {item?.phoneNumber}
+ {item?.phoneNumber}
),
"E-mail ID": (
- {item?.emailAddress}
+ {item?.emailAddress}
),
"KYC Status": (
-
- {item?.KYCStatus === true ? "Completed" : "Incompleted"}
-
+
+ {item?.KYCStatus === true ? "Completed" : "Incompleted"}
+
),
Action: (
{
- setActionId(item?.id)
- onOpen()}}
+ onClick={() => {
+ setActionId(item?.id);
+ onOpen();
+ }}
>
Ban Investor
@@ -212,6 +233,8 @@ const BankInvestor = () => {
),
}));
+ console.log(extractedArray);
+
const handleDelete = () => {
const updatedInvestorDetails = InvestorDetails.filter(
(sponsor) => sponsor.id !== actionId
@@ -253,32 +276,59 @@ const BankInvestor = () => {
value={searchTerm}
onChange={(e) => setSearchTerm(e.target.value)}
/>
+
+ {/* */}
+
+
@@ -302,11 +352,7 @@ const BankInvestor = () => {
alertHandler={handleDelete}
isLoading={isLoading}
/>
-
+
);
};
diff --git a/src/Pages/Admin/Investor/UnbanInvestor/UnbanInvestor.jsx b/src/Pages/Admin/Investor/UnbanInvestor/UnbanInvestor.jsx
index 834f5ab..96f24db 100644
--- a/src/Pages/Admin/Investor/UnbanInvestor/UnbanInvestor.jsx
+++ b/src/Pages/Admin/Investor/UnbanInvestor/UnbanInvestor.jsx
@@ -41,20 +41,6 @@ const UnbanInvestor = () => {
const [mouseEntered, setMouseEntered] = useState(false);
const [mouseEnteredId, setMouseEnteredId] = useState("");
const { isOpen: isOpen, onOpen: onOpen, onClose: onClose } = useDisclosure();
- const [pageSize, setPageSize] = useState(TABLE_PAGINATION?.size);
- const [currentPage, setCurrentPage] = useState(TABLE_PAGINATION?.page);
- const [searchTerm, setSearchTerm] = useState("");
- const [debouncedSearchTerm, setDebouncedSearchTerm] = useState("");
-
- // Debounce the search term to avoid making a request on every keystroke
- useEffect(() => {
- const handler = setTimeout(() => {
- setDebouncedSearchTerm(searchTerm);
- }, 500); // Adjust delay as needed
- return () => {
- clearTimeout(handler);
- };
- }, [searchTerm]);
const formatDate = (date) => {
return new Date(date).toLocaleDateString("en-GB", {
@@ -64,19 +50,43 @@ const UnbanInvestor = () => {
});
};
+ // =========================== [Use State] =============================
+ const [pageSize, setPageSize] = useState(TABLE_PAGINATION?.size);
+ const [currentPage, setCurrentPage] = useState(TABLE_PAGINATION?.page);
+ const [searchTerm, setSearchTerm] = useState("");
+ const [debouncedSearchTerm, setDebouncedSearchTerm] = useState("");
+
+ const [status, setStatus] = useState("");
+ const [kyc, setKyc] = useState("");
+ const [country, setCountry] = useState("");
+
+ // Debounce the search term to avoid making a request on every keystroke
+ useEffect(() => {
+ const handler = setTimeout(() => {
+ setDebouncedSearchTerm(searchTerm);
+ }, 500); // Adjust delay as needed
+ return () => {
+ clearTimeout(handler);
+ };
+ }, [searchTerm]);
+
const {
data,
isLoading: unbanLoading,
error,
refetch,
- } = useGetUnbanInvestorQuery({
- page: debouncedSearchTerm ? undefined : currentPage, // Omit pagination for search
- size: debouncedSearchTerm ? undefined : pageSize, // Omit pagination for search
- search: debouncedSearchTerm,
- },
- {
- skip: debouncedSearchTerm === "" && searchTerm !== "", // Skip if search is empty and it's not the initial request
- });
+ } = useGetUnbanInvestorQuery(
+ {
+ page: debouncedSearchTerm ? undefined : currentPage, // Omit pagination for search
+ size: debouncedSearchTerm ? undefined : pageSize, // Omit pagination for search
+ search: debouncedSearchTerm,
+ KYCStatus: kyc,
+ country_xid: country,
+ },
+ {
+ skip: debouncedSearchTerm === "" && searchTerm !== "", // Skip if search is empty and it's not the initial request
+ }
+ );
useEffect(() => {
// Simulate loading
@@ -132,7 +142,7 @@ const UnbanInvestor = () => {
color={"gray.600"}
className="d-flex align-items-center fw-bold web-text-small"
>
- {generateSerialNumber(index,currentPage, pageSize )}
+ {generateSerialNumber(index, currentPage, pageSize)}
),
Date: (
@@ -192,7 +202,7 @@ const UnbanInvestor = () => {
color={item?.KYCStatus === false ? "red" : "blue"}
px={2}
py={0.5}
- variant={'ghost'}
+ variant={"ghost"}
>
{item?.KYCStatus === true ? "Completed" : "Incompleted"}
@@ -207,9 +217,9 @@ const UnbanInvestor = () => {
colorScheme={"red"}
px={2}
py={0.5}
- onClick={()=>{
- setActionId(item?.id)
- onOpen()
+ onClick={() => {
+ setActionId(item?.id);
+ onOpen();
}}
>
Ban Investor
@@ -260,31 +270,57 @@ const UnbanInvestor = () => {
onChange={(e) => setSearchTerm(e.target.value)}
/>
+ {/* */}
+
+
diff --git a/src/Pages/Admin/Notification.jsx b/src/Pages/Admin/Notification.jsx
index b8beb97..19e3d80 100644
--- a/src/Pages/Admin/Notification.jsx
+++ b/src/Pages/Admin/Notification.jsx
@@ -322,6 +322,7 @@ const Notification = () => {
onSubmit={handleSubmit(onSubmit)}
btnLoading={isLoading}
>
+
{
selectedRadio={selectedRadio}
showRadioButton={true}
/>
+
);
diff --git a/src/Pages/Deposit/DepositRequest/DepositRequest.jsx b/src/Pages/Deposit/DepositRequest/DepositRequest.jsx
index 1d074fb..c10fa8a 100644
--- a/src/Pages/Deposit/DepositRequest/DepositRequest.jsx
+++ b/src/Pages/Deposit/DepositRequest/DepositRequest.jsx
@@ -47,7 +47,6 @@ const DepositRequest = () => {
const toast = useToast();
const { depositRequest, setDepositRequest, slideFromRight } =
useContext(GlobalStateContext);
- const [searchTerm, setSearchTerm] = useState("");
const [isLoading, setIsLoading] = useState(true);
const [deleteAlert, setDeleteAlert] = useState(false);
const [actionId, setActionId] = useState("");
@@ -63,9 +62,25 @@ const DepositRequest = () => {
onOpen: onRejectOpen,
onClose: onRejectClose,
} = useDisclosure();
+
+
+ // =========================== [Use State] =============================
const [pageSize, setPageSize] = useState(TABLE_PAGINATION?.size);
const [currentPage, setCurrentPage] = useState(TABLE_PAGINATION?.page);
+ const [searchTerm, setSearchTerm] = useState("");
+ const [debouncedSearchTerm, setDebouncedSearchTerm] = useState("");
+
+ // Debounce the search term to avoid making a request on every keystroke
+ useEffect(() => {
+ const handler = setTimeout(() => {
+ setDebouncedSearchTerm(searchTerm);
+ }, 500); // Adjust delay as needed
+ return () => {
+ clearTimeout(handler);
+ };
+ }, [searchTerm]);
+
const formatDate = (date) => {
return new Date(date).toLocaleDateString("en-GB", {
@@ -80,7 +95,14 @@ const DepositRequest = () => {
isLoading: depositRequestLoading,
error,
refetch,
- } = useGetDepositRequestQuery({ page: currentPage, size: pageSize });
+ } = useGetDepositRequestQuery({
+ page: debouncedSearchTerm ? undefined : currentPage, // Omit pagination for search
+ size: debouncedSearchTerm ? undefined : pageSize, // Omit pagination for search
+ search: debouncedSearchTerm,
+ },
+ {
+ skip: debouncedSearchTerm === "" && searchTerm !== "", // Skip if search is empty and it's not the initial request
+ });
// Use useEffect to refetch data when the component mounts
useEffect(() => {
@@ -135,7 +157,7 @@ const DepositRequest = () => {
})
.sort((b, a) => new Date(a.createdAt) - new Date(b.createdAt));
- const extractedArray = filteredData?.map((item, idx) => ({
+ const extractedArray = data?.data?.rows?.map((item, idx) => ({
// id: item?.id,
"Sr.no": (
{
const toast = useToast();
const { depositHistory, setDepositHistory, slideFromRight } =
useContext(GlobalStateContext);
- const [searchTerm, setSearchTerm] = useState("");
const [isLoading, setIsLoading] = useState(true);
const [deleteAlert, setDeleteAlert] = useState(false);
const [actionId, setActionId] = useState(false);
@@ -62,15 +61,36 @@ const DepositHistory = () => {
// onClose: onRejectClose,
// } = useDisclosure();
+ // =========================== [Use State] =============================
const [pageSize, setPageSize] = useState(TABLE_PAGINATION?.size);
const [currentPage, setCurrentPage] = useState(TABLE_PAGINATION?.page);
+ const [searchTerm, setSearchTerm] = useState("");
+ const [debouncedSearchTerm, setDebouncedSearchTerm] = useState("");
+ // Debounce the search term to avoid making a request on every keystroke
+ useEffect(() => {
+ const handler = setTimeout(() => {
+ setDebouncedSearchTerm(searchTerm);
+ }, 500); // Adjust delay as needed
+ return () => {
+ clearTimeout(handler);
+ };
+ }, [searchTerm]);
+
+
const {
data,
error,
refetch,
isLoading: depositHistoryLoading,
- } = useGetDepositHistoryQuery({ page: currentPage, size: pageSize });
+ } = useGetDepositHistoryQuery({
+ page: debouncedSearchTerm ? undefined : currentPage, // Omit pagination for search
+ size: debouncedSearchTerm ? undefined : pageSize, // Omit pagination for search
+ search: debouncedSearchTerm,
+ },
+ {
+ skip: debouncedSearchTerm === "" && searchTerm !== "", // Skip if search is empty and it's not the initial request
+ });
// Use useEffect to refetch data when the component mounts
useEffect(() => {
@@ -131,7 +151,7 @@ const DepositHistory = () => {
// onViewOpen();
// };
- const extractedArray = filteredData?.map((item, idx) => ({
+ const extractedArray = data?.data?.rows?.map((item, idx) => ({
"Sr.no": (
{
- const [isLoading, setIsLoading] = useState(false);
- const [ selectedRadio, setSelectedRadio] = useState([])
- const [value, setValue] = useState('');
+ const [isLoading, setIsLoading] = useState(false);
+ const [selectedRadio, setSelectedRadio] = useState([]);
+ const [subject, setSubject] = useState("");
+ const [value, setValue] = useState(""); // Quill content (body)
+ const toast = useToast();
- const {
- data : investorDetails,
- isLoading: investorDetailsLoading,
- refetch,
- } = useGetUnbanInvestorQuery();
+ const [sendCustomNotification] = useSendCustomEmailMutation();
-
- // ====================================================[Table Setup]================================================================
+ // ===========================[Table Setup]==============================
const tableHeadRow = [
"Sr N/O",
"Date",
@@ -35,11 +44,17 @@ const EmailNotification = () => {
"KYC Status",
];
-
-
const [pageSize, setPageSize] = useState(TABLE_PAGINATION?.size);
const [currentPage, setCurrentPage] = useState(TABLE_PAGINATION?.page);
+ const {
+ data: investorDetails,
+ isLoading: investorDetailsLoading,
+ refetch,
+ } = useGetUnbanInvestorQuery({
+ page: currentPage, // Omit pagination for search
+ size: 10000, // Omit pagination for search
+ });
const extractedArray = investorDetails?.data?.rows?.map((item, idx) => ({
id: item?.principal_xid,
@@ -50,7 +65,7 @@ const EmailNotification = () => {
color={"gray.600"}
className="d-flex align-items-center fw-bold web-text-small"
>
- {generateSerialNumber(idx,currentPage, pageSize )}
+ {generateSerialNumber(idx, currentPage, pageSize)}
),
Date: (
@@ -110,7 +125,7 @@ const EmailNotification = () => {
color={item?.KYCStatus === false ? "red" : "blue"}
px={2}
py={0.5}
- variant={'ghost'}
+ variant={"ghost"}
>
{item?.KYCStatus === true ? "Completed" : "Incompleted"}
@@ -118,71 +133,171 @@ const EmailNotification = () => {
),
}));
-
- console.log(value);
-
-
const modules = {
toolbar: [
- [{ 'header': '1'}, { 'header': '2'}, { 'font': [] }],
- [{size: []}],
- ['bold', 'italic', 'underline', 'strike', 'blockquote'],
- [{'list': 'ordered'}, {'list': 'bullet'}],
- // ['link', 'image', 'video'],
- ['clean']
+ // [{ header: "1" }, { header: "2" },
+ // // { font: [] }
+ // ],
+ // [{ size: [] }],
+ ["bold", "italic", "underline", "strike", "blockquote"],
+ [{ list: "ordered" }, { list: "bullet" }],
+ ["clean"],
],
};
- return (
-
+
+ // Main submission logic
+ const handleSend = async (e) => {
+ e.preventDefault(); // Prevent default form submission
+
+ if (!subject || !value) {
+ toast({
+ render: () => (
+
+ ),
+ });
+ return;
+ }
+
+ if (selectedRadio.length === 0) {
+ toast({
+ render: () => (
+
+ ),
+ });
+ return;
+ }
+
+ setIsLoading(true);
+
+ const emailPayload = {
+ subject,
+ body: value,
+ principal_xid: selectedRadio,
+ };
-{/* */}
-
-
-
- Customize your email
-
-
-
- We'll never share your email.
-
+ try {
+ const res = await sendCustomNotification(emailPayload)
+ console.log(res);
+ if (res?.error) {
+ toast({
+ render: () => (
+
+ ),
+ });
+ setIsLoading(false)
+ }else if(res?.data){
+ toast({
+ render: () => (
+
+ ),
+ });
+ setIsLoading(false)
+ setSubject("")
+ setValue("")
+ setSelectedRadio([])
+ }else{
+ toast({
+ render: () => (
+
+ ),
+ });
+ setIsLoading(false)
+ }
- {/*
- Output:
-
- */}
- {/* */}
+ } catch (error) {
+
+ }
+
+ };
+
+ return (
+
+
+ {/*
+
+ Customize your email
+
+ */}
+
+
+ Subject
+ setSubject(e.target.value)}
+ focusBorderColor="forestGreen.300"
+ rounded={0.5}
+ type="text"
+ />
+ {/* Entered subject will be reflected on emails subject body. */}
+
+
+ Create Custom body
+
+
+ {/*
+ We'll never share your email.
+ */}
+
+
+
+
+
+
+
-
- )
-}
+
-export default EmailNotification
\ No newline at end of file
+
+ }
+ rounded={"sm"}
+ size={"sm"}
+ colorScheme="forestGreen"
+ type="submit"
+ isLoading={isLoading}
+ onClick={handleSend}
+ >
+ Send Email
+
+
+
+ );
+};
+
+export default EmailNotification;
diff --git a/src/Pages/Fawateer/FawateerRequest.jsx b/src/Pages/Fawateer/FawateerRequest.jsx
index 5adffd9..0c9311d 100644
--- a/src/Pages/Fawateer/FawateerRequest.jsx
+++ b/src/Pages/Fawateer/FawateerRequest.jsx
@@ -42,9 +42,6 @@ import { exportToExcel, generateSerialNumber } from "../../Constants/Constants";
import { LuFileSpreadsheet } from "react-icons/lu";
-
-
-
const FawateerRequest = () => {
const navigate = useNavigate();
const toast = useToast();
diff --git a/src/Pages/FawateerChecker/ApproveHistory/ApproveHistoryChecker.jsx b/src/Pages/FawateerChecker/ApproveHistory/ApproveHistoryChecker.jsx
index b61ac66..58d792e 100644
--- a/src/Pages/FawateerChecker/ApproveHistory/ApproveHistoryChecker.jsx
+++ b/src/Pages/FawateerChecker/ApproveHistory/ApproveHistoryChecker.jsx
@@ -202,7 +202,7 @@ const ApproveHistory = () => {
fontWeight={"500"}
className="d-flex align-items-center web-text-small"
>
- {
-
+ }
),
Status: (
diff --git a/src/Pages/FawateerChecker/ApproveHistory/ApproveHistoryMaker.jsx b/src/Pages/FawateerChecker/ApproveHistory/ApproveHistoryMaker.jsx
index db922eb..f0d0e25 100644
--- a/src/Pages/FawateerChecker/ApproveHistory/ApproveHistoryMaker.jsx
+++ b/src/Pages/FawateerChecker/ApproveHistory/ApproveHistoryMaker.jsx
@@ -137,7 +137,7 @@ import {
"Status",
];
- const extractedArray = filteredData?.map((item, idx) => ({
+ const extractedArray = data?.data?.rows?.map((item, idx) => ({
// id: item?.id,
"Sr.no": (
@@ -223,7 +223,7 @@ import {
fontWeight={"500"}
className="d-flex align-items-center web-text-small"
>
-
-
+ }
),
Status: (
diff --git a/src/Pages/IO_Management/CreateIO/IOCashDetails.jsx b/src/Pages/IO_Management/CreateIO/IOCashDetails.jsx
index 7bdcc7f..6ba03f8 100644
--- a/src/Pages/IO_Management/CreateIO/IOCashDetails.jsx
+++ b/src/Pages/IO_Management/CreateIO/IOCashDetails.jsx
@@ -324,6 +324,8 @@ const IOCashDetails = () => {
variant={"outline"}
rounded={"sm"}
fontSize={"xs"}
+
+ isDisabled={ioCashExporteDetails?.length === 0}
>
Export xls
diff --git a/src/Pages/IO_Management/CreateIO/IONAVDetails.jsx b/src/Pages/IO_Management/CreateIO/IONAVDetails.jsx
index 44831de..cedd8c8 100644
--- a/src/Pages/IO_Management/CreateIO/IONAVDetails.jsx
+++ b/src/Pages/IO_Management/CreateIO/IONAVDetails.jsx
@@ -236,6 +236,7 @@ const IONAVDetails = () => {
variant={"outline"}
rounded={"sm"}
fontSize={"xs"}
+ isDisabled={ioNavExport?.length === 0}
>
Export xls
diff --git a/src/Pages/IO_Management/CreateIO/Investors.jsx b/src/Pages/IO_Management/CreateIO/Investors.jsx
index 38cb41c..b30466a 100644
--- a/src/Pages/IO_Management/CreateIO/Investors.jsx
+++ b/src/Pages/IO_Management/CreateIO/Investors.jsx
@@ -504,6 +504,7 @@ console.log(IODetails?.investors);
fontSize={"xs"}
w={100}
me={2}
+ isDisabled={exportInvestorDetails?.length === 0}
>
Export xls
diff --git a/src/Pages/Investor_Management/InvestorDetails/InvestorDetails.jsx b/src/Pages/Investor_Management/InvestorDetails/InvestorDetails.jsx
index 66c9cf0..1f7f5a9 100644
--- a/src/Pages/Investor_Management/InvestorDetails/InvestorDetails.jsx
+++ b/src/Pages/Investor_Management/InvestorDetails/InvestorDetails.jsx
@@ -372,6 +372,8 @@ const InvestorDetails = () => {
fontSize={"xs"}
w={100}
me={2}
+
+ isDisabled={exportInvestor?.length === 0}
>
Export xls
diff --git a/src/Pages/WithDrawal/DrawalRequest/PendingRequest.jsx b/src/Pages/WithDrawal/DrawalRequest/PendingRequest.jsx
index 9bb35bf..21bd4f7 100644
--- a/src/Pages/WithDrawal/DrawalRequest/PendingRequest.jsx
+++ b/src/Pages/WithDrawal/DrawalRequest/PendingRequest.jsx
@@ -29,15 +29,12 @@ const PendingRequest = () => {
const toast = useToast();
const { slideFromRight, pendingRequest, setPendingRequest } =
useContext(GlobalStateContext);
- const [searchTerm, setSearchTerm] = useState("");
const [isLoading, setIsLoading] = useState(true);
const [deleteAlert, setDeleteAlert] = useState(false);
const [actionId, setActionId] = useState(false);
const [mouseEntered, setMouseEntered] = useState(false);
const [mouseEnteredId, setMouseEnteredId] = useState("");
- const [pageSize, setPageSize] = useState(TABLE_PAGINATION?.size);
- const [currentPage, setCurrentPage] = useState(TABLE_PAGINATION?.page);
const formatDate = (date) => {
return new Date(date).toLocaleDateString('en-GB', {
@@ -58,12 +55,41 @@ const PendingRequest = () => {
onClose: onRejectClose,
} = useDisclosure();
+
+
+
+
+ // =========================== [Use State] =============================
+ const [pageSize, setPageSize] = useState(TABLE_PAGINATION?.size);
+ const [currentPage, setCurrentPage] = useState(TABLE_PAGINATION?.page);
+ const [searchTerm, setSearchTerm] = useState("");
+ const [debouncedSearchTerm, setDebouncedSearchTerm] = useState("");
+
+ // Debounce the search term to avoid making a request on every keystroke
+ useEffect(() => {
+ const handler = setTimeout(() => {
+ setDebouncedSearchTerm(searchTerm);
+ }, 500); // Adjust delay as needed
+ return () => {
+ clearTimeout(handler);
+ };
+ }, [searchTerm]);
+
+
+
const {
data,
isLoading: drawalRequestLoading,
error,
refetch
- } = useGetDrawalRequestQuery({ page: currentPage, size: pageSize });
+ } = useGetDrawalRequestQuery({
+ page: debouncedSearchTerm ? undefined : currentPage, // Omit pagination for search
+ size: debouncedSearchTerm ? undefined : pageSize, // Omit pagination for search
+ search: debouncedSearchTerm,
+ },
+ {
+ skip: debouncedSearchTerm === "" && searchTerm !== "", // Skip if search is empty and it's not the initial request
+ });
@@ -122,7 +148,7 @@ const PendingRequest = () => {
- const extractedArray = filteredData?.map((item, idx) => ({
+ const extractedArray = data?.data?.rows?.map((item, idx) => ({
// id: item?.id,
"Sr.no": (
{
const toast = useToast();
const { slideFromRight, viewHistory, setViewHistory } =
useContext(GlobalStateContext);
- const [searchTerm, setSearchTerm] = useState("");
const [isLoading, setIsLoading] = useState(true);
const [deleteAlert, setDeleteAlert] = useState(false);
const [actionId, setActionId] = useState(false);
@@ -56,15 +55,39 @@ const ViewHistory = () => {
});
};
+
+
+
+ // =========================== [Use State] =============================
const [pageSize, setPageSize] = useState(TABLE_PAGINATION?.size);
const [currentPage, setCurrentPage] = useState(TABLE_PAGINATION?.page);
+ const [searchTerm, setSearchTerm] = useState("");
+ const [debouncedSearchTerm, setDebouncedSearchTerm] = useState("");
+
+ // Debounce the search term to avoid making a request on every keystroke
+ useEffect(() => {
+ const handler = setTimeout(() => {
+ setDebouncedSearchTerm(searchTerm);
+ }, 500); // Adjust delay as needed
+ return () => {
+ clearTimeout(handler);
+ };
+ }, [searchTerm]);
+
const {
data,
error,
isLoading: drawalHistoryLoading,
refetch
- } = useGetDrawalHistoryQuery({ page: currentPage, size: pageSize });
+ } = useGetDrawalHistoryQuery({
+ page: debouncedSearchTerm ? undefined : currentPage, // Omit pagination for search
+ size: debouncedSearchTerm ? undefined : pageSize, // Omit pagination for search
+ search: debouncedSearchTerm,
+ },
+ {
+ skip: debouncedSearchTerm === "" && searchTerm !== "", // Skip if search is empty and it's not the initial request
+ });
// Use useEffect to refetch data when the component mounts
diff --git a/src/Routes/Nav.js b/src/Routes/Nav.js
index 8818b5f..c581df5 100644
--- a/src/Routes/Nav.js
+++ b/src/Routes/Nav.js
@@ -213,11 +213,11 @@ export const nav = [
path: "/notification",
icon: MdNotificationsNone,
},
- // {
- // title: "Email Notification",
- // path: "/email",
- // icon: AtSignIcon,
- // },
+ {
+ title: "Email Notification",
+ path: "/email",
+ icon: AtSignIcon,
+ },
{
title: "Contact Details",
path: "/contact",
diff --git a/src/Services/ban.investor.service.js b/src/Services/ban.investor.service.js
index 12e840d..beaba8f 100644
--- a/src/Services/ban.investor.service.js
+++ b/src/Services/ban.investor.service.js
@@ -20,18 +20,18 @@ export const banInvestorDetails = createApi({
getUnbanInvestor: builder.query({
- query: ({ page, size, search, kycStatus, country }) => {
+ query: ({ page, size, search, userStatus, KYCStatus, country_xid }) => {
// Start with the base URL, including searchTerm
- let baseURL = `/investorDetails/admin/getAllUnbanned/?search=${search || ""}`;
+ let baseURL = `/investorDetails/admin/getAllUnbanned?search=${search || ""}&userStatus=${userStatus ||""}&KYCStatus=${KYCStatus || ""}&country_xid=${country_xid||""}`;
// Conditionally append kycStatus if it's defined
- if (kycStatus) {
- baseURL += `&kycStatus=${kycStatus}`;
+ if (KYCStatus) {
+ baseURL += `&KYCStatus=${KYCStatus}`;
}
// Conditionally append country if it's defined
- if (country) {
- baseURL += `&country=${country}`;
+ if (country_xid) {
+ baseURL += `&country_xid=${country_xid}`;
}
// Conditionally append page and size parameters if they are defined
@@ -41,13 +41,33 @@ export const banInvestorDetails = createApi({
return baseURL;
},
- providesTags: ["getBanInvestor"],
+ providesTags: ["getUnbanInvestor"],
}),
getbanInvestor: builder.query({
- query: () => `/investorDetails/admin/getAllBanned`,
+ query: ({ page, size, search, userStatus, KYCStatus, country_xid }) => {
+ // Start with the base URL, including searchTerm
+ let baseURL = `/investorDetails/admin/getAllBanned?search=${search || ""}&userStatus=${userStatus ||""}&KYCStatus=${KYCStatus || ""}&country_xid=${country_xid||""}`;
+
+ // Conditionally append kycStatus if it's defined
+ if (KYCStatus) {
+ baseURL += `&KYCStatus=${KYCStatus}`;
+ }
+
+ // Conditionally append country if it's defined
+ if (country_xid) {
+ baseURL += `&country_xid=${country_xid}`;
+ }
+
+ // Conditionally append page and size parameters if they are defined
+ if (page !== undefined && size !== undefined) {
+ baseURL += `&page=${page}&size=${size}`;
+ }
+
+ return baseURL;
+ },
providesTags: ["getBanInvestor"],
}),
diff --git a/src/Services/contact.service.js b/src/Services/contact.service.js
index c8eb562..74dc6cb 100644
--- a/src/Services/contact.service.js
+++ b/src/Services/contact.service.js
@@ -51,9 +51,26 @@ export const contact = createApi({
body: data,
}),
}),
+
+
+
+
+
+ sendCustomEmail : builder.mutation({
+ query: (data) => ({
+ url: `/notification/admin/send-custom-email`,
+ method: "POST",
+ body: data,
+ }),
+ }),
+
+
+
+
+
}),
});
// Export hooks for usage in functional components
-export const { useGetContactQuery, useUpdateContactMutation, useSendNotificationMutation } = contact;
+export const { useGetContactQuery, useUpdateContactMutation, useSendNotificationMutation, useSendCustomEmailMutation } = contact;
diff --git a/src/Services/delete.request.service.js b/src/Services/delete.request.service.js
index 61e657f..a8aabb5 100644
--- a/src/Services/delete.request.service.js
+++ b/src/Services/delete.request.service.js
@@ -41,8 +41,14 @@ export const deleteRequest = createApi({
}),
getDeleteHistory: builder.query({
- query: () => `/account/admin/history`,
- providesTags: ["getDeleteHistory"],
+ query: ({ page, size, search }) => {
+ let baseURL = `/account/admin/history?search=${search || ""}`;
+ if (page !== undefined && size !== undefined) {
+ baseURL += `&page=${page}&size=${size}`; // Only add pagination if both are defined
+ }
+ return baseURL;
+ },
+ providesTags: ["getDrawalRequest"],
}),
}),
});
diff --git a/src/Services/deposit.request.service.js b/src/Services/deposit.request.service.js
index 65a77fb..1a8ccd2 100644
--- a/src/Services/deposit.request.service.js
+++ b/src/Services/deposit.request.service.js
@@ -11,10 +11,30 @@ export const depositRequest = createApi({
baseQuery: baseQuery,
tagTypes: ["getDepositRequest", "getDepositHistory"],
endpoints: (builder) => ({
+
+
+
+
getDepositRequest: builder.query({
- query: ({page, size}) => `/deposit/admin/pending-requests?page=${page}&size=${size}`,
+ query: ({ page, size, search, userStatus, KYCStatus, country_xid }) => {
+ // Start with the base URL, including searchTerm
+ let baseURL = `/deposit/admin/pending-requests?search=${search || ""}`;
+
+ // Conditionally append page and size parameters if they are defined
+ if (page !== undefined && size !== undefined) {
+ baseURL += `&page=${page}&size=${size}`;
+ }
+
+ return baseURL;
+ },
providesTags: ["getDepositRequest"],
}),
+
+
+
+
+
+
getDepositRequestById: builder.query({
query: (id) => `/deposit/admin/getById/${id}`,
@@ -38,10 +58,30 @@ export const depositRequest = createApi({
invalidatesTags: ["getDepositRequest", "getDepositHistory"],
}),
+
+
+
getDepositHistory: builder.query({
- query: ({page, size}) => `/deposit/admin/history?page=${page}&size=${size}`,
+ query: ({ page, size, search, userStatus, KYCStatus, country_xid }) => {
+ // Start with the base URL, including searchTerm
+ let baseURL = `/deposit/admin/history?search=${search || ""}`;
+
+ // Conditionally append page and size parameters if they are defined
+ if (page !== undefined && size !== undefined) {
+ baseURL += `&page=${page}&size=${size}`;
+ }
+
+ return baseURL;
+ },
providesTags: ["getDepositHistory"],
}),
+
+
+
+
+
+
+
}),
});
diff --git a/src/Services/drawal.request.service.js b/src/Services/drawal.request.service.js
index 11c87c1..5ed9e3b 100644
--- a/src/Services/drawal.request.service.js
+++ b/src/Services/drawal.request.service.js
@@ -12,8 +12,17 @@ export const drawalRequest = createApi({
tagTypes: ["getDrawalRequest", "getDepositHistory"],
endpoints: (builder) => ({
+
+
+
getDrawalRequest: builder.query({
- query: () => `/withdrawal/admin`,
+ query: ({ page, size, search }) => {
+ let baseURL = `/withdrawal/admin?search=${search || ""}`;
+ if (page !== undefined && size !== undefined) {
+ baseURL += `&page=${page}&size=${size}`; // Only add pagination if both are defined
+ }
+ return baseURL;
+ },
providesTags: ["getDrawalRequest"],
}),
@@ -39,10 +48,23 @@ export const drawalRequest = createApi({
invalidatesTags: ["getDepositRequest", "getDepositHistory"],
}),
+
getDrawalHistory: builder.query({
- query: () => `/withdrawal/admin/history`,
+ query: ({ page, size, search, userStatus, KYCStatus, country_xid }) => {
+ // Start with the base URL, including searchTerm
+ let baseURL = `/withdrawal/admin/history?search=${search || ""}`;
+
+ // Conditionally append page and size parameters if they are defined
+ if (page !== undefined && size !== undefined) {
+ baseURL += `&page=${page}&size=${size}`;
+ }
+
+ return baseURL;
+ },
providesTags: ["getDepositHistory"],
}),
+
+
}),
});
diff --git a/src/Services/fawateer.request.service.js b/src/Services/fawateer.request.service.js
index 9483863..1a5e90a 100644
--- a/src/Services/fawateer.request.service.js
+++ b/src/Services/fawateer.request.service.js
@@ -15,7 +15,7 @@ export const fawateerRequest = createApi({
getFawateerRequest: builder.query({
query: ({ page, size, searchTerm }) => {
- let baseURL = `/fawateer/admin/Pending?search_data=${searchTerm || ""}`;
+ let baseURL = `/fawateer/admin/Pending?search=${searchTerm || ""}`;
if (page !== undefined && size !== undefined) {
baseURL += `&page=${page}&size=${size}`; // Only add pagination if both are defined
}
@@ -41,7 +41,7 @@ export const fawateerRequest = createApi({
getFawateerForMakerRequest: builder.query({
query: ({ page, size, searchTerm }) => {
- let baseURL = `/fawateer/admin?search_data=${searchTerm || ""}`;
+ let baseURL = `/fawateer/admin?search=${searchTerm || ""}`;
if (page !== undefined && size !== undefined) {
baseURL += `&page=${page}&size=${size}`; // Only add pagination if both are defined
}
diff --git a/src/Services/investor.details.service.js b/src/Services/investor.details.service.js
index f01c239..9de2784 100644
--- a/src/Services/investor.details.service.js
+++ b/src/Services/investor.details.service.js
@@ -28,6 +28,9 @@ export const investorDetails = createApi({
}),
+
+
+
// =====[get investment details ]
getInvestorsDetailsById: builder.query({
query: (id) => `/investorDetails/admin/byId/${id}`,
diff --git a/src/Services/io.service.js b/src/Services/io.service.js
index cd64730..12b4c3e 100644
--- a/src/Services/io.service.js
+++ b/src/Services/io.service.js
@@ -328,7 +328,7 @@ export const ioService = createApi({
getSponserMaster: builder.query({
query: ({ page, size, searchTerm }) => {
- let baseURL = `/sponsor/admin/?search_data=${searchTerm || ""}`;
+ let baseURL = `/sponsor/admin/?search=${searchTerm || ""}`;
if (page !== undefined && size !== undefined) {
baseURL += `&page=${page}&size=${size}`; // Only add pagination if both are defined
}