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 {
|
return {
|
||||||
isLoading,
|
isLoading,
|
||||||
feedback: data?.data,
|
feedback: Array.isArray(data?.data) ? data?.data : [],
|
||||||
columns,
|
columns,
|
||||||
pathName,
|
pathName,
|
||||||
router,
|
router,
|
||||||
|
|||||||
@@ -57,7 +57,6 @@ function countActiveFilters(values: Record<string, unknown>): number {
|
|||||||
"form_types",
|
"form_types",
|
||||||
"main_classification",
|
"main_classification",
|
||||||
"classifications",
|
"classifications",
|
||||||
"cpv_codes",
|
|
||||||
];
|
];
|
||||||
for (const key of textKeys) {
|
for (const key of textKeys) {
|
||||||
const v = values[key];
|
const v = values[key];
|
||||||
@@ -213,12 +212,6 @@ const TenderListFilters = ({
|
|||||||
label="Classifications (comma-separated)"
|
label="Classifications (comma-separated)"
|
||||||
type="text"
|
type="text"
|
||||||
/>
|
/>
|
||||||
<InputGroup
|
|
||||||
{...filterRegister("cpv_codes")}
|
|
||||||
name="cpv_codes"
|
|
||||||
label="CPV codes (comma-separated)"
|
|
||||||
type="text"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</CollapsibleFilterSection>
|
</CollapsibleFilterSection>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user