Merge branch 'feature-dev' of http://git.wdipl.com/Siddhesh.More/tanami-admin-panel into feature-dev

This commit is contained in:
YasinShaikh123
2024-08-16 17:59:44 +05:30
2 changed files with 24 additions and 8 deletions

View File

@@ -99,14 +99,14 @@ const DepositRequest = () => {
});
}, 300);
// ====================================================[Table Filter]================================================================
const filteredData = data?.data?.rows.filter((item) => {
const filteredData = data?.data?.rows
.filter((item) => {
// Filter by name (case insensitive)
const name = [item.firstName, item.lastName, item.countryName].filter(Boolean).join(' ');
const searchLower = searchTerm.toLowerCase();
const nameMatches = name.toLowerCase().includes(searchLower);
// Filter by status
// Filter by status (Uncomment and use if needed)
// const status = item.status;
// const statusLower = status ? "active" : "inactive";
@@ -116,7 +116,8 @@ const DepositRequest = () => {
// (statusFilter === "inactive" && status === false);
return nameMatches;
});
})
.sort((b, a) => new Date(a.createdAt) - new Date(b.createdAt));
console.log(data?.data?.rows);

View File

@@ -92,14 +92,29 @@ const DepositHistory = () => {
});
}, 300);
// ====================================================[Table Filter]================================================================
const filteredData = data?.data?.rows.filter((item) => {
// Combine firstName, lastName, and countryName for filtering
const filteredData = data?.data?.rows
.filter((item) => {
// Filter by name (case insensitive)
const name = [item.firstName, item.lastName, item.countryName].filter(Boolean).join(' ');
const searchLower = searchTerm.toLowerCase();
const nameMatches = name.toLowerCase().includes(searchLower);
// Filter by status (Uncomment and use if needed)
// const status = item.status;
// const statusLower = status ? "active" : "inactive";
// const statusMatches =
// statusFilter === "all" ||
// (statusFilter === "active" && status === true) ||
// (statusFilter === "inactive" && status === false);
return nameMatches;
});
})
.sort((b, a) => new Date(a.createdAt) - new Date(b.createdAt));
// const handleView = (id) => {