sort 구조 변경
This commit is contained in:
@@ -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
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user