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