add filter msisdn OR fullname and set limit to 100

This commit is contained in:
Wikzyy
2025-05-02 09:32:23 +07:00
parent bd5003c669
commit 749566f574
2 changed files with 10 additions and 2 deletions

View File

@ -147,6 +147,7 @@ const ManageWalletContextProvider = ({ children }: { children: React.ReactNode }
try { try {
sorting = sorting.length == 0 ? [{ id: 'name', desc: false }] : sorting; sorting = sorting.length == 0 ? [{ id: 'name', desc: false }] : sorting;
filter = filter.length == 0 ? {} : { 'wallets.name': { like: `%${filter[0].value?.toLowerCase()}%` } }; filter = filter.length == 0 ? {} : { 'wallets.name': { like: `%${filter[0].value?.toLowerCase()}%` } };
const response = await GetData(`${API_URL_MASTER_DATA}/wallet/list`, { const response = await GetData(`${API_URL_MASTER_DATA}/wallet/list`, {
limit, limit,
page: page + 1, page: page + 1,

View File

@ -60,10 +60,17 @@ const TransactionDisbursement = () => {
const fetchCustomerMsisdn = async (sorting: any, filterValue: string) => { const fetchCustomerMsisdn = async (sorting: any, filterValue: string) => {
const filter: any = const filter: any =
filterValue.trim().length === 0 ? {} : { msisdn: { like: `%${filterValue}%` } }; filterValue.trim().length === 0
? {}
: {
or: [
{ msisdn: { like: `%${filterValue}%` } },
{ fullname: { like: `%${filterValue}%` } }
]
};
const query: any = { const query: any = {
limit: 25, limit: 100,
page: 1, page: 1,
with_deleted: false, with_deleted: false,
order_field: sorting[0].id, order_field: sorting[0].id,