Changes in Expensfilter panel at on apply and clear fitler is closed.

This commit is contained in:
Kartik Sharma 2025-10-17 10:24:35 +05:30
parent a8ae0fac70
commit 78b721dad7
2 changed files with 5 additions and 5 deletions

View File

@ -78,14 +78,14 @@ const DocumentFilterPanel = forwardRef(
? moment.utc(values.endDate, "DD-MM-YYYY").toISOString()
: null,
});
closePanel();
// closePanel();
};
const onClear = () => {
reset(DocumentFilterDefaultValues);
setResetKey((prev) => prev + 1);
onApply(DocumentFilterDefaultValues);
closePanel();
// closePanel();
};
if (isLoading) return <div>Loading...</div>;

View File

@ -43,7 +43,7 @@ const ExpenseFilterPanel = forwardRef(({ onApply, handleGroupBy, setFilterdata }
return {
...defaultFilter,
statusIds: status ? [status] : defaultFilter.statusIds || [],
projectIds: selectedProjectId ? [selectedProjectId] : [],
projectIds: defaultFilter.projectIds || [],
createdByIds: defaultFilter.createdByIds || [],
paidById: defaultFilter.paidById || [],
ExpenseTypeIds: defaultFilter.ExpenseTypeIds || [],
@ -96,7 +96,7 @@ const ExpenseFilterPanel = forwardRef(({ onApply, handleGroupBy, setFilterdata }
endDate: moment.utc(formData.endDate, "DD-MM-YYYY").toISOString(),
});
handleGroupBy(selectedGroup.id);
closePanel();
// closePanel();
};
const onClear = () => {
@ -105,7 +105,7 @@ const ExpenseFilterPanel = forwardRef(({ onApply, handleGroupBy, setFilterdata }
setSelectedGroup(groupByList[0]);
onApply(defaultFilter);
handleGroupBy(groupByList[0].id);
closePanel();
// closePanel();
if (status) {
navigate("/expenses", { replace: true });
}