Skip to content

Commit f98de26

Browse files
meili-bors[bot]ahmednfwelabrunoocasali
authored
Merge #324
324: make `query` parameter optional in `IndexSearchQuery` r=brunoocasali a=ahmednfwela # Pull Request ## Related issue Fixes #321 ## What does this PR do? - make `query` parameter optional in `IndexSearchQuery` ## PR checklist Please check if your PR fulfills the following requirements: - [x] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)? - [x] Have you read the contributing guidelines? - [x] Have you made sure that the title is accurate and descriptive of the changes? Thank you so much for contributing to Meilisearch! Co-authored-by: Ahmed Fwela <ahmednfwela@bdaya-dev.com> Co-authored-by: Bruno Casali <brunoocasali@gmail.com>
2 parents c7978f6 + e719c5f commit f98de26

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

lib/src/http_request.dart

+7-7
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class HttpRequest {
6565
queryParameters: queryParameters,
6666
data: data,
6767
);
68-
} on DioError catch (e) {
68+
} on DioException catch (e) {
6969
return _throwException(e);
7070
}
7171
}
@@ -86,7 +86,7 @@ class HttpRequest {
8686
contentType: contentType,
8787
),
8888
);
89-
} on DioError catch (e) {
89+
} on DioException catch (e) {
9090
return _throwException(e);
9191
}
9292
}
@@ -107,7 +107,7 @@ class HttpRequest {
107107
contentType: contentType,
108108
),
109109
);
110-
} on DioError catch (e) {
110+
} on DioException catch (e) {
111111
return _throwException(e);
112112
}
113113
}
@@ -128,7 +128,7 @@ class HttpRequest {
128128
contentType: contentType,
129129
),
130130
);
131-
} on DioError catch (e) {
131+
} on DioException catch (e) {
132132
return _throwException(e);
133133
}
134134
}
@@ -145,14 +145,14 @@ class HttpRequest {
145145
data: data,
146146
queryParameters: queryParameters,
147147
);
148-
} on DioError catch (e) {
148+
} on DioException catch (e) {
149149
return _throwException(e);
150150
}
151151
}
152152

153-
Never _throwException(DioError e) {
153+
Never _throwException(DioException e) {
154154
final message = e.message ?? '';
155-
if (e.type == DioErrorType.badResponse) {
155+
if (e.type == DioExceptionType.badResponse) {
156156
throw MeiliSearchApiException.fromHttpBody(message, e.response?.data);
157157
} else {
158158
throw CommunicationException(message);

lib/src/query_parameters/index_search_query.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class IndexSearchQuery extends SearchQuery {
1010

1111
const IndexSearchQuery({
1212
required this.indexUid,
13-
required this.query,
13+
this.query,
1414
super.offset,
1515
super.limit,
1616
super.page,

test/multi_index_search_test.dart

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ void main() {
3232
ktag.toMeiliAttribute().eq("Romance".toMeiliValue()),
3333
),
3434
IndexSearchQuery(
35-
query: "",
3635
indexUid: index2.uid,
3736
filterExpression: ktag.toMeiliAttribute().eq("Tale".toMeiliValue()),
3837
),

0 commit comments

Comments
 (0)