diff --git a/src/Pages/IO_Management/ViewIO/ViewIOTable.jsx b/src/Pages/IO_Management/ViewIO/ViewIOTable.jsx
index f49c62e..5dc47ff 100644
--- a/src/Pages/IO_Management/ViewIO/ViewIOTable.jsx
+++ b/src/Pages/IO_Management/ViewIO/ViewIOTable.jsx
@@ -92,6 +92,9 @@ const ViewIOTable = () => {
size: pageSize,
ioStatus_xid: statusFilter,
search: debouncedSearchTerm,
+ },
+ {
+ skip: debouncedSearchTerm === "" && searchTerm !== "", // Skip if search is empty and it's not the initial request
});
console.log(data);
diff --git a/src/Pages/Investor_Management/InvestorDetails/InvestorDetails.jsx b/src/Pages/Investor_Management/InvestorDetails/InvestorDetails.jsx
index d0ededd..7e5c707 100644
--- a/src/Pages/Investor_Management/InvestorDetails/InvestorDetails.jsx
+++ b/src/Pages/Investor_Management/InvestorDetails/InvestorDetails.jsx
@@ -77,8 +77,17 @@ const InvestorDetails = () => {
error,
} = useGetInvestorsQuery({
page: debouncedSearchTerm ? undefined : currentPage, // Omit pagination for search
- size: debouncedSearchTerm ? undefined : pageSize, // Omit pagination for search
+ size: debouncedSearchTerm ? undefined : pageSize, // Omit pagination for search userStatus KYCStatus investorType_xid
search: debouncedSearchTerm,
+ userStatus: status,
+ KYCStatus: kyc,
+ country_xid: country
+
+
+
+
+
+
},
{
skip: debouncedSearchTerm === "" && searchTerm !== "", // Skip if search is empty and it's not the initial request
@@ -108,56 +117,12 @@ const InvestorDetails = () => {
"E-mail ID",
"Type",
"KYC Status",
- // "Status",
+ "Status",
"Action",
];
- const handleUpdateStatus = debounce((id) => {
- setInvestorDetails((prevData) =>
- prevData.map((InvestorDetails) =>
- InvestorDetails.id === id ? { ...InvestorDetails } : InvestorDetails
- )
- );
- toast({
- render: () => ,
- });
- }, 300);
// ====================================================[Table Filter]================================================================
- const filteredData = investorDetails?.data?.rows?.filter((item) => {
- // Filter by name (case insensitive)
- const name = [item?.principal?.firstName, item?.principal?.lastName, item?.country?.countryName, item?.principal?.mobileNumber, item?.principal?.emailAddress].filter(Boolean).join(' ');
- const searchLower = searchTerm.toLowerCase();
- const nameMatches = name?.toLowerCase().includes(searchLower);
-
- // Filter by status
- // const status = item.status;
- // const statusLower = status ? "active" : "inactive";
-
- // const statusMatches =
- // statusFilter === "all" ||
- // (statusFilter === "active" && status === true) ||
- // (statusFilter === "inactive" && status === false);
-
- return nameMatches;
- });
-
-
-
- const customHeaders = [
- { label: "ID", key: "id" },
- { label: "Client ID", key: "clientReference_id" },
- { label: "First Name", key: "principal.firstName" }, // Nested property
- { label: "Last Name", key: "principal.lastName" }, // Nested property
- { label: "Country", key: "country.countryName" }, // Nested property
- { label: "Phone Number", key: "principal.mobileNumber" }, // Nested property
- { label: "E-mail ID", key: "principal.emailAddress" }, // Nested property
- { label: "Type", key: "investor_type.investorTypeName" }, // Nested property
- { label: "Status", key: "ioStatus" }, // Simple property
- { label: "KYC Status", key: "KYCStatus" }, // Simple property
- ];
-
-
const exportInvestor = investorDetails?.data?.rows?.map((item, idx) => ({
"Id": parseInt(item?.id, 10) || item?.id, // Convert to integer, fallback to string if conversion fails
"Client ID": item?.clientReference_id, // This is likely a string
@@ -171,10 +136,6 @@ const InvestorDetails = () => {
"KYC Status": item.KYCStatus ? "Completed" : "Not complete"
}));
- console.log(exportInvestor);
-
-
-
const extractedArray = investorDetails?.data?.rows?.map((item, idx) => ({
id: item?.id,
"Sr No": (
@@ -312,14 +273,6 @@ const InvestorDetails = () => {
setIsLoading(true);
};
- const handleEdit = (id) => {
- setActionId(id);
- onEditOpen();
- };
-
- console.log(investorDetails?.data?.totalItems);
-
-
return (
@@ -351,14 +304,16 @@ const InvestorDetails = () => {
size={"sm"}
fontSize={"xs"}
cursor={"pointer"}
+ onChange={(e) => setStatus(e.target.value)}
+ value={status}
>
-
-
-
-
+
+
+
({
getInvestors: builder.query({
- query: ({ page, size, search }) => {
+ query: ({ page, size, search, userStatus, KYCStatus, country_xid }) => {
// Start with the base URL, including searchTerm
- let baseURL = `/investorDetails/admin/?search=${search || ""}`;
+ let baseURL = `/investorDetails/admin/?search=${search || ""}&userStatus=${userStatus ||""}&KYCStatus=${KYCStatus || ""}&country_xid=${country_xid||""}`;
// Conditionally append page and size parameters if they are defined
if (page !== undefined && size !== undefined) {