mirror of
https://github.com/wger-project/flutter.git
synced 2026-12-07 00:05:01 +01:00
Fix error when there was no search query for exercises
This commit is contained in:
1 parent
1314c899d0
commit
ad672ae269
1 file changed
+4
@@ -151,6 +151,10 @@ class Exercises extends WgerBaseProvider with ChangeNotifier {
|
||||
/// We could do this locally, but the server has better text searching capabilities
|
||||
/// with postgresql.
|
||||
Future<List> searchExercise(String name) async {
|
||||
if (name.length <= 1) {
|
||||
return [];
|
||||
}
|
||||
|
||||
// Send the request
|
||||
final response = await client.get(
|
||||
makeUrl(_exerciseSearchPath, query: {'term': name}),
|
||||
|
||||
Reference in new issue
Block a user