Compare commits

...

4 Commits

Author SHA1 Message Date
Swapnil Bendal
965263a3f2 Merge remote-tracking branch 'origin/sprint10/reversal' into Sprint-10 2025-01-21 16:47:09 +05:30
YasinShaikh123
04a5d1280f approve history maker [ Search ] 2025-01-21 16:44:01 +05:30
YasinShaikh123
d40eadb35e [ Approve Historty maker search ] 2025-01-21 16:42:57 +05:30
YasinShaikh123
f4a2fd2889 [ update amount reseversl ] 2025-01-21 16:25:38 +05:30
4 changed files with 51 additions and 8 deletions

View File

@@ -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>
),

View File

@@ -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

View File

@@ -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

View File

@@ -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"],
}),