TP-31899 | fixes

This commit is contained in:
Aman Chaturvedi
2023-10-10 16:04:47 +05:30
parent 6b782f686c
commit 17cbe1eb03
2 changed files with 9 additions and 5 deletions

View File

@@ -59,6 +59,7 @@ const Filters: React.FC<{
};
const handleClearAll = () => {
onFilterChange({});
setSelectedFilterOptions({});
};

View File

@@ -129,9 +129,9 @@ const FeedbackDetailContainer: React.FC<IFeedbackDetailContainer> = ({ route: ro
filtersPayload
)
.then((res: { data: IFeedback[]; totalPage: number } | GenericType) => {
if (res?.data?.length) {
setFeedbackList(res.data);
setTotalPage(res.totalPage);
if (res?.data) {
setFeedbackList(res.data || []);
setTotalPage(res.totalPage || 0);
return;
}
throw res;
@@ -210,8 +210,11 @@ const FeedbackDetailContainer: React.FC<IFeedbackDetailContainer> = ({ route: ro
const handleFilterChange = (filters: TFilterOptions) => {
const filtersPayload = getFiltersPayload(filters);
fetchFeedbacks(filtersPayload);
setLoading(true);
setCurrentPage(1);
if (currentPage === 1) {
fetchFeedbacks(filtersPayload);
setLoading(true);
}
dispatch(setFeedbackFilters({ loanAccountNumber, filters }));
};