Added missing fussy search fileds and support for number
This commit is contained in:
@@ -27,6 +27,10 @@ export function useListSearch<T>(fields: string[][], rows: T[]) {
|
||||
if (typeof value === "string") {
|
||||
return value.toLowerCase().includes(searchText);
|
||||
}
|
||||
|
||||
if (typeof value === "number") {
|
||||
return (value as Number).toString().includes(searchText);
|
||||
}
|
||||
});
|
||||
});
|
||||
}, [fields, rows, text]);
|
||||
|
||||
@@ -390,7 +390,7 @@ interface PaypalPaymentWithUserData extends PaypalPayment {
|
||||
email: string;
|
||||
}
|
||||
|
||||
const paypalFilterRows = [["email"], ["name"]];
|
||||
const paypalFilterRows = [["email"], ["name"], ["orderId"], ["value"]];
|
||||
export default function PaymentRecord() {
|
||||
const [selectedCorporateUser, setSelectedCorporateUser] = useState<User>();
|
||||
const [selectedAgentUser, setSelectedAgentUser] = useState<User>();
|
||||
@@ -874,10 +874,12 @@ export default function PaymentRecord() {
|
||||
|
||||
const updatedPaypalPayments = useMemo(
|
||||
() =>
|
||||
paypalPayments.filter((p) => {
|
||||
paypalPayments
|
||||
.filter((p) => {
|
||||
const date = moment(p.createdAt);
|
||||
return date.isAfter(startDatePaymob) && date.isBefore(endDatePaymob);
|
||||
}).map((p) => {
|
||||
})
|
||||
.map((p) => {
|
||||
const user = users.find((x) => x.id === p.userId) as User;
|
||||
return { ...p, name: user?.name, email: user?.email };
|
||||
}),
|
||||
@@ -1508,7 +1510,9 @@ export default function PaymentRecord() {
|
||||
if (finalDate) {
|
||||
// basicly selecting a final day works as if I'm selecting the first
|
||||
// minute of that day. this way it covers the whole day
|
||||
setEndDatePaymob(moment(finalDate).endOf("day").toDate());
|
||||
setEndDatePaymob(
|
||||
moment(finalDate).endOf("day").toDate()
|
||||
);
|
||||
return;
|
||||
}
|
||||
setEndDatePaymob(null);
|
||||
|
||||
Reference in New Issue
Block a user