sort 구조 변경

This commit is contained in:
focp212@naver.com
2025-10-24 16:49:46 +09:00
parent c0c983be1a
commit 8e27c42a2d
6 changed files with 35 additions and 107 deletions

View File

@@ -61,19 +61,8 @@ export const EscrowListPage = () => {
const { mutateAsync: escrowList } = useEscrowListMutation();
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: EscrowListParams = {
const callList = () => {
let listParams: EscrowListParams = {
mid: mid,
searchType: 'ORDER_NUMBER',
searchKeyword: searchKeyword,
@@ -81,16 +70,14 @@ export const EscrowListPage = () => {
endDate: endDate,
deliveryStatus: deliveryStatus,
settlementStatus: settlementStatus,
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);
}
escrowList(listParams).then((rs: EscrowListResponse) => {
setListItems(rs.content);
});
@@ -114,26 +101,17 @@ export const EscrowListPage = () => {
};
const onClickToSort = (sort: SortTypeKeys) => {
setSortType(sort);
callList({
sortType: sort
});
};
const onClickToDeliveryStatus = (val: EscrowDeliveryStatus) => {
setDeliveryStatus(val);
callList({
val: val
});
};
useEffect(() => {
callList();
}, []);
useEffect(() => {
callList();
}, [
mid, searchType, searchKeyword,
startDate, endDate,
startDate, endDate, sortType,
deliveryStatus, settlementStatus,
minAmount, maxAmount
]);