From 129a79c66914d1db2d9765758ad393624d18b76f Mon Sep 17 00:00:00 2001
From: YasinShaikh123 <123150391+YasinShaikh123@users.noreply.github.com>
Date: Fri, 23 Aug 2024 12:23:44 +0530
Subject: [PATCH] drawar history
---
src/Contexts/GlobalStateProvider.jsx | 228 ++-------------
src/Pages/AccountDeletion/DeletionHistory.jsx | 74 ++---
src/Pages/AccountDeletion/DeletionRequest.jsx | 68 +++--
src/Pages/AccountDeletion/InvestorComment.jsx | 85 ++++++
.../DepositRequest/DepositRequestApprove.jsx | 15 +-
.../DepositRequest/DepositRequestReject.jsx | 4 +-
.../InvestorDetails/InvestorDetails.jsx | 2 +-
.../InvestorDetails/ProfileView.jsx | 8 +
.../DrawalRequest/PendingRequest.jsx | 5 +-
.../WithDrawal/DrawalView/ViewHistory.jsx | 268 ++++++++++--------
src/Routes/Routes.js | 4 +-
src/Services/drawal.request.service.js | 9 +-
12 files changed, 354 insertions(+), 416 deletions(-)
create mode 100644 src/Pages/AccountDeletion/InvestorComment.jsx
diff --git a/src/Contexts/GlobalStateProvider.jsx b/src/Contexts/GlobalStateProvider.jsx
index 11a7dfa..e15b34b 100644
--- a/src/Contexts/GlobalStateProvider.jsx
+++ b/src/Contexts/GlobalStateProvider.jsx
@@ -962,112 +962,14 @@ const GlobalStateProvider = ({ children }) => {
]);
const [deleteHistory, setDeleteHistory] = useState([
{
- id: uuidv4(),
- date: "2024-01-15",
- Distribution: "Office supplies",
- charge: "200.50",
- year: "2024",
- quarter: "Q1",
- amount: 1500,
- },
- {
- id: uuidv4(),
- date: "2024-02-10",
- Distribution: "Marketing expenses",
- charge: "450.00",
- year: "2024",
- quarter: "Q1",
- amount: 2000,
- },
- {
- id: uuidv4(),
- date: "2024-03-05",
- Distribution: "Software subscription",
- charge: "300.75",
- year: "2024",
- quarter: "Q1",
- amount: 1200,
- },
- {
- id: uuidv4(),
- date: "2024-04-18",
- Distribution: "Travel expenses",
- charge: "600.30",
- year: "2024",
- quarter: "Q2",
- amount: 2500,
- },
- {
- id: uuidv4(),
- date: "2024-05-22",
- Distribution: "Consulting fees",
- charge: "800.00",
- year: "2024",
- quarter: "Q2",
- amount: 3000,
- },
- {
- id: uuidv4(),
- date: "2024-06-14",
- Distribution: "Office rent",
- charge: "1200.25",
- year: "2024",
- quarter: "Q2",
- amount: 3500,
- },
- {
- id: uuidv4(),
- date: "2024-07-09",
- Distribution: "Utilities",
- charge: "150.40",
- year: "2024",
- quarter: "Q3",
- amount: 1000,
- },
- {
- id: uuidv4(),
- date: "2024-08-29",
- Distribution: "Employee training",
- charge: "500.00",
- year: "2024",
- quarter: "Q3",
- amount: 1800,
- },
- {
- id: uuidv4(),
- date: "2024-09-13",
- Distribution: "Website maintenance",
- charge: "350.65",
- year: "2024",
- quarter: "Q3",
- amount: 1400,
- },
- {
- id: uuidv4(),
- date: "2024-10-23",
- Distribution: "Advertising",
- charge: "900.50",
- year: "2024",
- quarter: "Q4",
- amount: 2200,
- },
- {
- id: uuidv4(),
- date: "2024-10-23",
- Distribution: "Advertising",
- charge: "900.50",
- year: "2024",
- quarter: "Q4",
- amount: 2200,
- },
- {
- id: uuidv4(),
- date: "2024-10-23",
- Distribution: "Advertising",
- charge: "900.50",
- year: "2024",
- quarter: "Q4",
- amount: 2200,
+ id: 1,
+ firstName: "satyam",
+ lastName: "Bendal",
+ clientId: "QA00000003",
+ RequestedOn: "2024-08-21T08:12:08.000Z",
+ phoneNumber: "6387524874",
+ country: "Qatar",
+ status: "Approved",
},
]);
const [investorRequest, setInvestorRequest] = useState([
@@ -1182,112 +1084,14 @@ const GlobalStateProvider = ({ children }) => {
]);
const [deleteRequest, setDeleteRequest] = useState([
{
- id: uuidv4(),
- date: getRandomDate(startDate, endDate),
- Distribution: "lorem ipsum dummy text",
- charge: "500",
- year: "2024",
- quater: "Q 1",
- amount: 1000,
- },
- {
- id: uuidv4(),
- date: getRandomDate(startDate, endDate),
- Distribution: "lorem ipsum dummy text",
- charge: "500",
- year: "2024",
- quater: "Q 1",
- amount: 1000,
- },
- {
- id: uuidv4(),
- date: getRandomDate(startDate, endDate),
- Distribution: "lorem ipsum dummy text",
- charge: "500",
- year: "2024",
- quater: "Q 1",
- amount: 1000,
- },
- {
- id: uuidv4(),
- date: getRandomDate(startDate, endDate),
- Distribution: "lorem ipsum dummy text",
- charge: "500",
- year: "2024",
- quater: "Q 1",
- amount: 1000,
- },
- {
- id: uuidv4(),
- date: getRandomDate(startDate, endDate),
- Distribution: "lorem ipsum dummy text",
- charge: "500",
- year: "2024",
- quater: "Q 1",
- amount: 1000,
- },
- {
- id: uuidv4(),
- date: getRandomDate(startDate, endDate),
- Distribution: "lorem ipsum dummy text",
- charge: "500",
- year: "2024",
- quater: "Q 1",
- amount: 1000,
- },
- {
- id: uuidv4(),
- date: getRandomDate(startDate, endDate),
- Distribution: "lorem ipsum dummy text",
- charge: "500",
- year: "2024",
- quater: "Q 1",
- amount: 1000,
- },
- {
- id: uuidv4(),
- date: getRandomDate(startDate, endDate),
- Distribution: "lorem ipsum dummy text",
- charge: "500",
- year: "2024",
- quater: "Q 1",
- amount: 1000,
- },
- {
- id: uuidv4(),
- date: getRandomDate(startDate, endDate),
- Distribution: "lorem ipsum dummy text",
- charge: "500",
- year: "2024",
- quater: "Q 1",
- amount: 1000,
- },
- {
- id: uuidv4(),
- date: getRandomDate(startDate, endDate),
- Distribution: "lorem ipsum dummy text",
- charge: "500",
- year: "2024",
- quater: "Q 1",
- amount: 1000,
- },
- {
- id: uuidv4(),
- date: getRandomDate(startDate, endDate),
- Distribution: "lorem ipsum dummy text",
- charge: "500",
- year: "2024",
- quater: "Q 1",
- amount: 1000,
- },
- {
- id: uuidv4(),
- date: getRandomDate(startDate, endDate),
- Distribution: "lorem ipsum dummy text",
- charge: "500",
- year: "2024",
- quater: "Q 1",
- amount: 1000,
+ id: 1,
+ firstName: "satyam",
+ lastName: "Bendal",
+ clientId: "QA00000003",
+ RequestedOn: "2024-08-21T08:12:08.000Z",
+ phoneNumber: "6387524874",
+ country: "Qatar",
+ // status: "Approved",
},
]);
const [viewIO, setViewIO] = useState([
diff --git a/src/Pages/AccountDeletion/DeletionHistory.jsx b/src/Pages/AccountDeletion/DeletionHistory.jsx
index ba11bc2..2b4eebd 100644
--- a/src/Pages/AccountDeletion/DeletionHistory.jsx
+++ b/src/Pages/AccountDeletion/DeletionHistory.jsx
@@ -36,38 +36,30 @@ const DeletionHistory = () => {
setIsLoading(false);
}, 1500);
- // Cleanup the timer on component unmount
+ // Cleanup the timer on component unmount
return () => clearTimeout(timer);
}, []);
// ====================================================[Table Filter]================================================================
const filteredData = deleteHistory.filter((item) => {
// Filter by name (case insensitive)
- const name = item.Distribution;
+ const name = item.firstName;
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;
});
// ====================================================[Table Setup]================================================================
const tableHeadRow = [
"Sr No.",
- "Date",
- "Distribution Amount",
- "Charges (USD)",
- "Year",
- "Quater",
- "Action",
+ "Request On",
+ "Client ID",
+ "First Name",
+ "Last Name",
+ "Country",
+ "Phone Number",
+ "Status"
];
const extractedArray = filteredData?.map((item, index) => ({
@@ -83,7 +75,7 @@ const DeletionHistory = () => {
{index + 1}.
),
- "Date": (
+ "Request On": (
{
{formatDate(item.date)}
),
- "Distribution Amount": (
+ "Client ID": (
{
className="d-flex align-items-center web-text-small"
fontWeight={'500'}
>
- {item.Distribution}
+ {item.clientId}
),
- "Charges (USD)": (
+ "First Name": (
{
className="d-flex align-items-center web-text-small"
fontWeight={'500'}
>
- {item.charge}
+ {item.firstName}
{/* {formatDate(item.charge)} */}
),
- Year: (
+ "Last Name": (
{
className="d-flex align-items-center web-text-small"
fontWeight={'500'}
>
- {item.year}
+ {item.lastName}
),
- Quater: (
+ "Country": (
{
className="d-flex align-items-center web-text-small"
fontWeight={'500'}
>
- {item.quarter}
+ {item.country}
),
- Action: (
-
-
-
-
-
-
+ "Phone Number": (
+
+ {item.phoneNumber}
+
+ ),
+ "Status": (
+
+ {item.status}
+
),
}));
diff --git a/src/Pages/AccountDeletion/DeletionRequest.jsx b/src/Pages/AccountDeletion/DeletionRequest.jsx
index a094386..9e01424 100644
--- a/src/Pages/AccountDeletion/DeletionRequest.jsx
+++ b/src/Pages/AccountDeletion/DeletionRequest.jsx
@@ -6,6 +6,7 @@ import {
HStack,
Input,
Text,
+ useDisclosure,
useToast,
} from "@chakra-ui/react";
import React, { useContext, useEffect, useState } from "react";
@@ -15,6 +16,7 @@ import Pagination from "../../Components/Pagination";
import GlobalStateContext from "../../Contexts/GlobalStateContext";
import CustomAlertDialog from "../../Components/CustomAlertDialog";
import { formatDate } from "../../Components/Functions/UTCConvertor";
+import InvestorComment from "./InvestorComment";
// import { formatDate } from "../../Components/Functions/UTCConvertor";
const DeletionRequest = () => {
@@ -28,6 +30,12 @@ const DeletionRequest = () => {
const [mouseEntered, setMouseEntered] = useState(false);
const [mouseEnteredId, setMouseEnteredId] = useState("");
+ const {
+ isOpen: isOpen,
+ onOpen: onOpen,
+ onClose: onClose,
+ } = useDisclosure();
+
useEffect(() => {
// Simulate loading
const timer = setTimeout(() => {
@@ -41,7 +49,7 @@ const DeletionRequest = () => {
// ====================================================[Table Filter]================================================================
const filteredData = deleteRequest.filter((item) => {
// Filter by name (case insensitive)
- const name = item.Distribution;
+ const name = item.firstName;
const searchLower = searchTerm.toLowerCase();
const nameMatches = name.toLowerCase().includes(searchLower);
@@ -60,12 +68,13 @@ const DeletionRequest = () => {
// ====================================================[Table Setup]================================================================
const tableHeadRow = [
"Sr No.",
- "Date",
- "Distribution Amount",
- "Charges (USD)",
- "Year",
- "Quater",
- "Amount",
+ "Request On",
+ "Client ID",
+ "First Name",
+ "Last Name",
+ "Country",
+ "Phone Number",
+ "Status"
];
const extractedArray = filteredData?.map((item, index) => ({
@@ -81,7 +90,7 @@ const DeletionRequest = () => {
{index + 1}.
),
- "Date": (
+ "Request On": (
{
{formatDate(item.date)}
),
- "Distribution Amount": (
+ "Client ID": (
- {item.Distribution}
+ {item.clientId}
),
- "Charges (USD)": (
+ "First Name": (
{
className="d-flex align-items-center web-text-small"
fontWeight={'500'}
>
- {item.charge}
+ {item.firstName}
{/* {formatDate(item.charge)} */}
),
- Year: (
+ "Last Name": (
{
className="d-flex align-items-center web-text-small"
fontWeight={'500'}
>
- {item.year}
+ {item.lastName}
),
- Quater: (
-
- {item.quater}
+ {item.country}
),
-
- Amount: (
-
- {item.amount}
+ {item.phoneNumber}
+
+ ),
+ "Status": (
+
+ Review
),
}));
@@ -213,6 +233,10 @@ const DeletionRequest = () => {
alertHandler={handleDelete}
isLoading={isLoading}
/>
+
);
};
diff --git a/src/Pages/AccountDeletion/InvestorComment.jsx b/src/Pages/AccountDeletion/InvestorComment.jsx
new file mode 100644
index 0000000..35c33ea
--- /dev/null
+++ b/src/Pages/AccountDeletion/InvestorComment.jsx
@@ -0,0 +1,85 @@
+import {
+ Box,
+ Button,
+ FormControl,
+ FormLabel,
+ Modal,
+ ModalBody,
+ ModalCloseButton,
+ ModalContent,
+ ModalFooter,
+ ModalHeader,
+ ModalOverlay,
+ Textarea,
+} from "@chakra-ui/react";
+import React from "react";
+
+const InvestorComment = ({ isOpen, onClose }) => {
+ return (
+
+
+
+
+
+
+
+
+
+ Investor Comment
+
+
+
+ Admin Commment
+
+
+
+
+
+
+
+
+
+
+
+ );
+};
+
+export default InvestorComment;
diff --git a/src/Pages/Deposit/DepositRequest/DepositRequestApprove.jsx b/src/Pages/Deposit/DepositRequest/DepositRequestApprove.jsx
index c51491d..96bc711 100644
--- a/src/Pages/Deposit/DepositRequest/DepositRequestApprove.jsx
+++ b/src/Pages/Deposit/DepositRequest/DepositRequestApprove.jsx
@@ -24,7 +24,6 @@ import { useForm } from "react-hook-form";
import { useGetDepositRequestByIdQuery, useUpdateDepositRequestMutation } from "../../../Services/deposit.request.service";
import FullscreenLoaders from "../../../Components/Loaders/FullscreenLoaders";
import ToastBox from "../../../Components/ToastBox";
-import { useGetDrawalRequestQuery } from "../../../Services/drawal.request.service";
const FILE_TYPES = ["image/jpeg", "image/png", "image/gif"];
@@ -45,13 +44,7 @@ const DepositRequestApprove = ({ isOpen, onClose, firstField, id, data:requestDa
const fileredData = requestData?.find((item)=> item?.id === id)
console.log(fileredData);
- const {
- data,
- isLoading: drawalRequestLoading,
- error,
- } = useGetDrawalRequestQuery();
- console.log(data?.data?.rows);
const [ updateDepositRequest ] = useUpdateDepositRequestMutation()
@@ -114,10 +107,10 @@ const DepositRequestApprove = ({ isOpen, onClose, firstField, id, data:requestDa
setFile(selectedFile);
};
- // const { data, isLoading } =
- // (id, {
- // skip: !id,
- // });
+ const { data, isLoading } =
+ (id, {
+ skip: !id,
+ });
useEffect(() => {
if (data) {
diff --git a/src/Pages/Deposit/DepositRequest/DepositRequestReject.jsx b/src/Pages/Deposit/DepositRequest/DepositRequestReject.jsx
index f5e6968..c5e01f2 100644
--- a/src/Pages/Deposit/DepositRequest/DepositRequestReject.jsx
+++ b/src/Pages/Deposit/DepositRequest/DepositRequestReject.jsx
@@ -101,10 +101,10 @@ const DepositRequestReject = ({ isOpen, onClose, firstField ,id}) => {
}
return (
-
+
- Reject
+ Investor Comment
{isLoading ? (
diff --git a/src/Pages/Investor_Management/InvestorDetails/InvestorDetails.jsx b/src/Pages/Investor_Management/InvestorDetails/InvestorDetails.jsx
index d139bcd..275c2b6 100644
--- a/src/Pages/Investor_Management/InvestorDetails/InvestorDetails.jsx
+++ b/src/Pages/Investor_Management/InvestorDetails/InvestorDetails.jsx
@@ -88,7 +88,7 @@ const InvestorDetails = () => {
"Country",
"Phone Number",
"E-mail ID",
- "Investor Type",
+ "Investor Type",
"KYC Status",
"Status",
"Action",
diff --git a/src/Pages/Investor_Management/InvestorDetails/ProfileView.jsx b/src/Pages/Investor_Management/InvestorDetails/ProfileView.jsx
index 26cb6b1..b59ef9c 100644
--- a/src/Pages/Investor_Management/InvestorDetails/ProfileView.jsx
+++ b/src/Pages/Investor_Management/InvestorDetails/ProfileView.jsx
@@ -146,6 +146,14 @@ const ProfileView = () => {
section: "Personal Details",
width: "32%",
},
+ {
+ label: "App Notification",
+ value: foundObject?.IsAppNotificationEnabled === 1 ? "Yes" : "No",
+ type: "text",
+ isRequired: true,
+ section: "Bank Details",
+ width: "32%",
+ },
];
const groupedFields = formFields.reduce((groups, field) => {
diff --git a/src/Pages/WithDrawal/DrawalRequest/PendingRequest.jsx b/src/Pages/WithDrawal/DrawalRequest/PendingRequest.jsx
index e2f616e..1743547 100644
--- a/src/Pages/WithDrawal/DrawalRequest/PendingRequest.jsx
+++ b/src/Pages/WithDrawal/DrawalRequest/PendingRequest.jsx
@@ -18,12 +18,11 @@ import GlobalStateContext from "../../../Contexts/GlobalStateContext";
import CustomAlertDialog from "../../../Components/CustomAlertDialog";
import { formatDate } from "../../../Components/Functions/UTCConvertor";
import { CheckIcon, CloseIcon } from "@chakra-ui/icons";
-import DrawalRequestApprove from "./DrawalRequestApprove";
import DrawalRequestReject from "./DrawalRequestReject";
import { useGetDrawalRequestQuery } from "../../../Services/drawal.request.service";
import { TABLE_PAGINATION } from "../../../Constants/Paginations";
-import NormalTable from "../../../Components/DataTable/NormalTable";
-// import DrawalRequestApprove from "./DrawalRequestApprove";
+import NormalTable from "../../../Components/DataTable/NormalTable"
+import DrawalRequestApprove from "./DrawalRequestApprove";
const PendingRequest = () => {
const toast = useToast();
diff --git a/src/Pages/WithDrawal/DrawalView/ViewHistory.jsx b/src/Pages/WithDrawal/DrawalView/ViewHistory.jsx
index c010f99..96b7122 100644
--- a/src/Pages/WithDrawal/DrawalView/ViewHistory.jsx
+++ b/src/Pages/WithDrawal/DrawalView/ViewHistory.jsx
@@ -12,7 +12,7 @@ import {
} from "@chakra-ui/react";
import React, { useContext, useEffect, useState } from "react";
import { OPACITY_ON_LOAD } from "../../../Layout/animations";
-import DataTable from "../../../Components/DataTable/DataTable";
+import NormalTable from "../../../Components/DataTable/NormalTable";
import Pagination from "../../../Components/Pagination";
import GlobalStateContext from "../../../Contexts/GlobalStateContext";
import CustomAlertDialog from "../../../Components/CustomAlertDialog";
@@ -20,28 +20,42 @@ import { formatDate } from "../../../Components/Functions/UTCConvertor";
import { CheckIcon, CloseIcon } from "@chakra-ui/icons";
import ConfirmModal from "./ConfirmModal";
import RejectModal from "./RejectModal";
+import { TABLE_PAGINATION } from "../../../Constants/Paginations";
+import { useGetDepositHistoryQuery } from "../../../Services/deposit.request.service";
+import { useGetDrawalHistoryQuery } from "../../../Services/drawal.request.service";
// import { formatDate } from "../../Components/Functions/UTCConvertor";
const ViewHistory = () => {
const toast = useToast();
const { slideFromRight, viewHistory, setViewHistory } =
useContext(GlobalStateContext);
- const [searchTerm, setSearchTerm] = useState("");
+ 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: isConfirmOpen,
+ // onOpen: onConfirmOpen,
+ // onClose: onConfirmClose,
+ // } = useDisclosure();
+ // const {
+ // isOpen: isRejectOpen,
+ // onOpen: onRejectOpen,
+ // onClose: onRejectClose,
+ // } = useDisclosure();
+
+ const [pageSize, setPageSize] = useState(TABLE_PAGINATION?.size);
+ const [currentPage, setCurrentPage] = useState(TABLE_PAGINATION?.page);
+
const {
- isOpen: isConfirmOpen,
- onOpen: onConfirmOpen,
- onClose: onConfirmClose,
- } = useDisclosure();
- const {
- isOpen: isRejectOpen,
- onOpen: onRejectOpen,
- onClose: onRejectClose,
- } = useDisclosure();
+ data,
+ error,
+ isLoading: drawalHistoryLoading,
+ } = useGetDrawalHistoryQuery({ page: currentPage, size: pageSize });
+
+ console.log(data?.data?.rows);
useEffect(() => {
// Simulate loading
@@ -54,9 +68,9 @@ const ViewHistory = () => {
}, []);
// ====================================================[Table Filter]================================================================
- const filteredData = viewHistory.filter((item) => {
+ const filteredData = data?.data?.rows.filter((item) => {
// Filter by name (case insensitive)
- const name = item.clientId;
+ const name = item.firstName;
const searchLower = searchTerm.toLowerCase();
const nameMatches = name.toLowerCase().includes(searchLower);
@@ -86,116 +100,115 @@ const ViewHistory = () => {
"Amount in Investor currency",
"Status",
];
-
- const [extractedArray, setExtractedArray] = useState(
- filteredData?.map((item, index) => ({
- // id: item?.id,
- "Sr.no": (
-
- {index + 1}
+ const extractedArray = filteredData?.map((item, index) => ({
+ // id: item?.id,
+ "Sr.no": (
+
+ {index + 1}
+
+ ),
+ Date: (
+
+ {formatDate(item?.createdAt)}
+
+ ),
+ "Client ID": (
+
+ {item.clientReference_id}
+
+ ),
+ "First Name": (
+
+
+ {item.firstName}
- ),
- "Date": (
-
- {item.date}
+
+ ),
+ "Last Name": (
+
+
+ {item.lastName}
- ),
- "Client ID": (
-
- {item.clientId}
+
+ ),
+ Country: (
+
+
+ {item.countryName}
- ),
- "First Name": (
-
-
- {item.firstName}
-
-
- ),
- "Last Name": (
-
-
- {item.lastName}
-
-
- ),
- Country: (
-
-
- {item.country}
-
-
- ),
- "Phone Number": (
-
-
- {item.phoneNumber}
-
-
- ),
- Currency: (
-
-
- {item.currency}
-
-
- ),
- "Withdrawal Amount": (
-
-
- {item.withDrawalAmount}
-
-
- ),
- "Amount in Investor currency": (
-
-
- {item.amountcurrency}
-
-
- ),
- Status: (
-
- {
- // setActionId(item.id);
- // if (item.status === "Approved") {
- // onConfirmOpen();
- // } else {
- // onRejectOpen();
- // }
- // }}
- as={"span"}
- color={item.status === "Approved" ? "green" : "red"}
- >
- {item.status}
-
-
- ),
- }))
- );
+
+ ),
+ "Phone Number": (
+
+
+ {item.mobileNumber}
+
+
+ ),
+ Currency: (
+
+
+
+ {item.currencyCode}
+
+
+
+ ),
+ "Withdrawal Amount": (
+
+
+ {item.USDAmount}
+
+
+ ),
+ "Amount in Investor currency": (
+
+
+ {item.investorAmount}
+
+
+ ),
+ Status: (
+
+ {
+ // setActionId(item.id);
+ // if (item.status === "Approved") {
+ // onConfirmOpen();
+ // } else {
+ // onRejectOpen();
+ // }
+ // }}
+ as={"span"}
+ color={item.transactionStatus === "Approved" ? "green" : "red"}
+ >
+ {item.transactionStatus}
+
+
+ ),
+ }));
const handleDelete = () => {
const updatedSponsors = sponser.filter(
@@ -205,14 +218,14 @@ const ViewHistory = () => {
setTimeout(() => {
setSponser(updatedSponsors);
setDeleteAlert(false);
- setIsLoading(false);
+ setIsLoading(false);
}, 100);
setIsLoading(true);
};
return (
- {
+ /> */}
{
onChange={(e) => setSearchTerm(e.target.value)}
/>
-
+
- `/deposit/admin/history`,
- // providesTags: ["getDepositHistory"],
- // }),
+ getDrawalHistory: builder.query({
+ query: () => `/withdrawal/admin/history`,
+ providesTags: ["getDrawalHistory"],
+ }),
}),
});
@@ -50,4 +50,5 @@ export const drawalRequest = createApi({
export const {
useGetDrawalRequestQuery,
useUpdateDrawalRequestMutation,
+ useGetDrawalHistoryQuery
} = drawalRequest;