Compare commits
11 Commits
96f813f632
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 537e1520bf | |||
|
|
b141743190 | ||
|
|
f9d0b3ce6c | ||
|
|
965263a3f2 | ||
|
|
04a5d1280f | ||
|
|
d40eadb35e | ||
|
|
f4a2fd2889 | ||
| 35d3e07224 | |||
|
|
651c775c2a | ||
| 6c2a38becb | |||
| bddf7381a6 |
@@ -117,6 +117,7 @@ const BankDepositRequest = () => {
|
||||
"Last Name",
|
||||
"Country",
|
||||
"Phone Number",
|
||||
"Deposit Amount",
|
||||
"Action",
|
||||
];
|
||||
|
||||
@@ -212,17 +213,30 @@ const BankDepositRequest = () => {
|
||||
</Box>
|
||||
),
|
||||
Country: (
|
||||
<Box w={"80px"} isTruncated={true}>
|
||||
<Box isTruncated={true}>
|
||||
<Text as={"span"} color={"teal.900"}>
|
||||
{item?.countryName}
|
||||
</Text>
|
||||
</Box>
|
||||
),
|
||||
"Phone Number": (
|
||||
<Box w={"80px"} isTruncated={true}>
|
||||
<Box isTruncated={true}>
|
||||
<Text as={"span"} color={"teal.900"}>
|
||||
{/* {item?.mobileNumber} */}
|
||||
{item?.ISDcode + " " + item?.mobileNumber}
|
||||
{item?.ISDCode} {item?.mobileNumber}
|
||||
{/* {item?.ISDcode + " " + item?.mobileNumber} */}
|
||||
</Text>
|
||||
</Box>
|
||||
),
|
||||
"Deposit Amount": (
|
||||
<Box isTruncated={true} display={"flex"} justifyContent={"end"}>
|
||||
<Text as={"span"} color={"teal.900"} textAlign={"right"}>
|
||||
{parseFloat(item?.investorAmount || 0).toLocaleString(undefined, {
|
||||
minimumFractionDigits: 2,
|
||||
maximumFractionDigits: 2,
|
||||
})}
|
||||
<Badge ms={1} colorScheme="green">
|
||||
{item?.currencyCode}
|
||||
</Badge>
|
||||
</Text>
|
||||
</Box>
|
||||
),
|
||||
|
||||
@@ -80,13 +80,15 @@ const ApproveHistory = () => {
|
||||
{
|
||||
page: debouncedSearchTerm ? undefined : currentPage, // Omit pagination for search
|
||||
size: debouncedSearchTerm ? undefined : pageSize, // Omit pagination for search
|
||||
search: debouncedSearchTerm,
|
||||
searchTerm: debouncedSearchTerm,
|
||||
},
|
||||
{
|
||||
skip: debouncedSearchTerm === "" && searchTerm !== "", // Skip if search is empty and it's not the initial request
|
||||
}
|
||||
);
|
||||
|
||||
console.log(data?.data?.rows);
|
||||
|
||||
// Use useEffect to refetch data when the component mounts
|
||||
useEffect(() => {
|
||||
refetch();
|
||||
@@ -102,6 +104,15 @@ const ApproveHistory = () => {
|
||||
return () => clearTimeout(timer);
|
||||
}, []);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
const handler = setTimeout(() => {
|
||||
setDebouncedSearchTerm(searchTerm);
|
||||
}, 500); // Adjust delay as needed
|
||||
return () => {
|
||||
clearTimeout(handler);
|
||||
};
|
||||
}, [searchTerm]);
|
||||
// ====================================================[Table Filter]================================================================
|
||||
const filteredData = data?.data?.rows?.filter((item) => {
|
||||
// Filter by name (case insensitive)
|
||||
@@ -135,7 +146,7 @@ const ApproveHistory = () => {
|
||||
"Status",
|
||||
];
|
||||
|
||||
const extractedArray = filteredData?.map((item, idx) => ({
|
||||
const extractedArray = data?.data?.rows?.map((item, idx) => ({
|
||||
// id: item?.id,
|
||||
"Sr.no": (
|
||||
<Text
|
||||
|
||||
@@ -130,6 +130,7 @@ const ReversalFawateerDeposit = () => {
|
||||
"First Name",
|
||||
"Last Name",
|
||||
"Phone Number",
|
||||
"Deposit Amount (BHD)",
|
||||
"Action",
|
||||
];
|
||||
|
||||
@@ -193,6 +194,19 @@ const ReversalFawateerDeposit = () => {
|
||||
</Text>
|
||||
</Box>
|
||||
),
|
||||
"Deposit Amount (BHD)": (
|
||||
<Box isTruncated={true}>
|
||||
<Text as={"span"} color={"teal.900"} textAlign={"right"}>
|
||||
{parseFloat(item?.transaction_details?.investorAmount || 0).toLocaleString(undefined, {
|
||||
minimumFractionDigits: 2,
|
||||
maximumFractionDigits: 2,
|
||||
})}
|
||||
<Badge ms={1} colorScheme="green">
|
||||
{item?.currencyCode}
|
||||
</Badge>
|
||||
</Text>
|
||||
</Box>
|
||||
),
|
||||
Action: (
|
||||
<Box display={"flex"} justifyContent={"center"} gap={2}>
|
||||
<Tooltip
|
||||
|
||||
@@ -50,6 +50,11 @@ export const fawateerRequest = createApi({
|
||||
providesTags: ["getFawateerMakerRequest"],
|
||||
}),
|
||||
|
||||
// getApproveHistory: builder.query({
|
||||
// query: () => `/fawateer/admin/getAll`,
|
||||
// providesTags: ["getApproveHistory"],
|
||||
// }),
|
||||
|
||||
getApproveHistory: builder.query({
|
||||
query: ({ page, size, searchTerm }) => {
|
||||
let baseURL = `/fawateer/admin/getAll?search=${searchTerm || ""}`;
|
||||
@@ -57,7 +62,6 @@ export const fawateerRequest = createApi({
|
||||
baseURL += `&page=${page}&size=${size}`; // Only add pagination if both are defined
|
||||
}
|
||||
return baseURL;
|
||||
|
||||
},
|
||||
providesTags: ["getApproveHistory"],
|
||||
}),
|
||||
@@ -79,7 +83,7 @@ export const fawateerRequest = createApi({
|
||||
}),
|
||||
invalidatesTags: ["getFawateerRequest"],
|
||||
}),
|
||||
|
||||
|
||||
}),
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user