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

@@ -69,16 +69,13 @@ export const CashReceiptListPage = () => {
const { mutateAsync: cashReceiptSummary } = useCashReceiptSummaryMutation();
const { mutateAsync: downloadExcel } = useDownloadExcelMutation();
const callList = (option?: {
sortType?: SortTypeKeys,
val?: CashReceiptTransactionType
}) => {
const callList = () => {
let listSummaryParams: CashReceiptSummaryParams = {
mid: mid,
startDate: startDate,
endDate: endDate,
purposeType: purposeType,
transactionType: option?.val || transactionType,
transactionType: transactionType,
processResult: processResult,
searchNumberType: searchNumberType,
searchNumber: searchNumber,
@@ -86,16 +83,12 @@ export const CashReceiptListPage = () => {
};
let listParams: CashReceiptListParams = {
...listSummaryParams,
...{
page: pageParam
page: {
...pageParam,
...{ sortType: sortType }
}
};
if(listParams.page){
listParams.page.sortType = option?.sortType || sortType;
setPageParam(listParams.page);
}
cashReceiptList(listParams).then((rs: CashReceiptListResponse) => {
setListItems(rs.content);
});
@@ -126,25 +119,16 @@ export const CashReceiptListPage = () => {
};
const onClickToSort = (sort: SortTypeKeys) => {
setSortType(sort);
callList({
sortType: sort
});
};
const onClickToTransactionType = (val: CashReceiptTransactionType) => {
setTransactionType(val);
callList({
val: val
});
};
useEffect(() => {
callList();
}, []);
useEffect(() => {
callList();
}, [
mid, startDate, endDate,
mid, startDate, endDate, sortType,
purposeType, transactionType, processResult,
searchNumberType, searchNumber
]);