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:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user