fix(feedback-table): ensure feedback data is always an array

- Updated the feedback property in useFeedbackTablePresenter to return an empty array if data is not an array, preventing potential runtime errors.
- Removed the cpv_codes input field from TenderListFilters to streamline the filter options, enhancing user experience.
This commit is contained in:
AmirReza Jamali
2026-05-19 09:03:10 +03:30
parent fc53d6b556
commit d34d405cd3
2 changed files with 1 additions and 8 deletions
@@ -102,7 +102,7 @@ const useFeedbackTablePresenter = ({ id, paramKey }: IProps) => {
};
return {
isLoading,
feedback: data?.data,
feedback: Array.isArray(data?.data) ? data?.data : [],
columns,
pathName,
router,
@@ -57,7 +57,6 @@ function countActiveFilters(values: Record<string, unknown>): number {
"form_types",
"main_classification",
"classifications",
"cpv_codes",
];
for (const key of textKeys) {
const v = values[key];
@@ -213,12 +212,6 @@ const TenderListFilters = ({
label="Classifications (comma-separated)"
type="text"
/>
<InputGroup
{...filterRegister("cpv_codes")}
name="cpv_codes"
label="CPV codes (comma-separated)"
type="text"
/>
</div>
</CollapsibleFilterSection>