mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-08 06:25:45 +01:00
Calling search results without parameters (#2056)
Calling search results without parameters leads to "Cannot read properties of undefined (reading 'length')" error. It does not matter which search mask is called.
This commit is contained in:
2
gradle/changelog/empty_search.yaml
Normal file
2
gradle/changelog/empty_search.yaml
Normal file
@@ -0,0 +1,2 @@
|
||||
- type: fixed
|
||||
description: Calling search results without parameters ([#2056](https://github.com/scm-manager/scm-manager/pull/2056))
|
||||
@@ -113,7 +113,7 @@ export const useSearch = (query: string, optionParam = defaultSearchOptions): Ap
|
||||
["search", options.type, queryParams],
|
||||
() => apiClient.get(`${link}?${createQueryString(queryParams)}`).then((response) => response.json()),
|
||||
{
|
||||
enabled: query.length > 1,
|
||||
enabled: query?.length > 1,
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user