sort 구조 변경
This commit is contained in:
@@ -63,19 +63,8 @@ export const BillingListPage = () => {
|
||||
const { mutateAsync: billingList } = useBillingListMutation();
|
||||
const { mutateAsync: downloadExcel } = useDownloadExcelMutation();
|
||||
|
||||
const callList = (option?: {
|
||||
sortType?: SortTypeKeys,
|
||||
val?: string
|
||||
}) => {
|
||||
let newMinAmount = minAmount;
|
||||
if(!!minAmount && typeof(minAmount) === 'string'){
|
||||
newMinAmount = parseInt(minAmount);
|
||||
}
|
||||
let newMaxAmount = maxAmount;
|
||||
if(!!maxAmount && typeof(maxAmount) === 'string'){
|
||||
newMaxAmount = parseInt(maxAmount);
|
||||
}
|
||||
let listParams: BillingListParams = {
|
||||
const callList = () => {
|
||||
let listParams: BillingListParams = {
|
||||
mid: mid,
|
||||
searchType: searchType,
|
||||
searchKeyword: searchKeyword,
|
||||
@@ -84,15 +73,13 @@ export const BillingListPage = () => {
|
||||
requestStatus: requestStatus,
|
||||
processResult: processResult,
|
||||
paymentMethod: paymentMethod,
|
||||
minAmount: newMinAmount,
|
||||
maxAmount: newMaxAmount,
|
||||
page: pageParam
|
||||
minAmount: minAmount,
|
||||
maxAmount: maxAmount,
|
||||
page: {
|
||||
...pageParam,
|
||||
...{ sortType: sortType }
|
||||
}
|
||||
};
|
||||
|
||||
if(listParams.page){
|
||||
listParams.page.sortType = option?.sortType || sortType;
|
||||
setPageParam(listParams.page);
|
||||
}
|
||||
|
||||
billingList(listParams).then((rs: BillingListResponse) => {
|
||||
setListItems(rs.content);
|
||||
@@ -107,16 +94,10 @@ export const BillingListPage = () => {
|
||||
};
|
||||
const onClickToSort = (sort: SortTypeKeys) => {
|
||||
setSortType(sort);
|
||||
callList({
|
||||
sortType: sort
|
||||
});
|
||||
};
|
||||
|
||||
const onClickToRequestStatus = (val: BillingRequestStatus) => {
|
||||
setRequestStatus(val);
|
||||
callList({
|
||||
val: val
|
||||
});
|
||||
};
|
||||
|
||||
const onRequestDownload = (userEmail?: string) => {
|
||||
@@ -124,13 +105,10 @@ export const BillingListPage = () => {
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
callList();
|
||||
}, []);
|
||||
useEffect(() => {
|
||||
callList();
|
||||
}, [
|
||||
mid, searchType, searchKeyword,
|
||||
startDate, endDate,
|
||||
startDate, endDate, sortType,
|
||||
requestStatus, processResult, paymentMethod,
|
||||
minAmount, maxAmount
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user