diff --git a/src/entities/transaction/ui/list-item.tsx b/src/entities/transaction/ui/list-item.tsx
index c9d4d52..d865978 100644
--- a/src/entities/transaction/ui/list-item.tsx
+++ b/src/entities/transaction/ui/list-item.tsx
@@ -230,7 +230,7 @@ export const ListItem = ({
{
const { mutateAsync: vatReturnList } = useVatReturnListMutation();
- const callList = (option?: {
- sortType?: SortTypeKeys
- }) => {
+ const callList = () => {
let params: VatReturnListParams = {
mid: mid,
startMonth: startMonth,
endMonth: endMonth,
receiptType: receiptType,
targetType: targetType,
- page: pageParam
+ page: {
+ ...pageParam,
+ ...{ sortType: sortType }
+ }
};
- if(params.page){
- params.page.sortType = option?.sortType || sortType;
- setPageParam(params.page);
- }
+
vatReturnList(params).then((rs: VatReturnListResponse) => {
setListItems(rs.content);
});
-
};
const onClickToOpenFIlter = () => {
@@ -72,7 +69,7 @@ export const ListWrap = () => {
callList();
}, [
mid, startMonth, endMonth,
- receiptType, targetType
+ receiptType, targetType, sortType
]);
const getListDateGroup = () => {
diff --git a/src/pages/transaction/all-transaction/list-page.tsx b/src/pages/transaction/all-transaction/list-page.tsx
index d530e2c..58f4f64 100644
--- a/src/pages/transaction/all-transaction/list-page.tsx
+++ b/src/pages/transaction/all-transaction/list-page.tsx
@@ -74,17 +74,14 @@ export const AllTransactionListPage = () => {
const { mutateAsync: allTransactionListSummary } = useAllTransactionListSummaryMutation();
const { mutateAsync: downloadExcel } = useDownloadExcelMutation();
- const callList = (option?: {
- sortType?: SortTypeKeys,
- val?: string
- }) => {
+ const callList = () => {
let listSummaryParams: AllTransactionListSummaryParams = {
moid: moid,
tid: tid,
fromDate: fromDate,
toDate: toDate,
statusCode: statusCode,
- serviceCode: option?.val || serviceCode,
+ serviceCode: serviceCode,
minAmount: minAmount,
maxAmount: maxAmount,
dateCl: dateCl,
@@ -133,9 +130,6 @@ export const AllTransactionListPage = () => {
};
const onClickToSort = (sort: SortTypeKeys) => {
setSortType(sort);
- callList({
- sortType: sort
- });
};
const callServiceCodeOptions = () => {
let serviceCodes = useStore.getState().CommonStore.serviceCodes;
@@ -147,9 +141,6 @@ export const AllTransactionListPage = () => {
let val = e.target.value;
// onchagne 에서 useState가 즉시 반영 안되므로 값을 직접 바로 넘긴다.
setServiceCode(val);
- callList({
- val: val
- });
};
const getServiceCodeOptions = () => {
@@ -173,7 +164,7 @@ export const AllTransactionListPage = () => {
useEffect(() => {
callList();
}, [
- mid, moid, tid,
+ mid, moid, tid, sortType,
fromDate, toDate,
statusCode, serviceCode,
minAmount, maxAmount,
diff --git a/src/pages/transaction/billing/list-page.tsx b/src/pages/transaction/billing/list-page.tsx
index b1497e1..24c3350 100644
--- a/src/pages/transaction/billing/list-page.tsx
+++ b/src/pages/transaction/billing/list-page.tsx
@@ -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
]);
diff --git a/src/pages/transaction/cash-receipt/list-page.tsx b/src/pages/transaction/cash-receipt/list-page.tsx
index 3fb452a..5ac7341 100644
--- a/src/pages/transaction/cash-receipt/list-page.tsx
+++ b/src/pages/transaction/cash-receipt/list-page.tsx
@@ -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
]);
diff --git a/src/pages/transaction/escrow/list-page.tsx b/src/pages/transaction/escrow/list-page.tsx
index 3c4cca0..2099092 100644
--- a/src/pages/transaction/escrow/list-page.tsx
+++ b/src/pages/transaction/escrow/list-page.tsx
@@ -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
]);