Add search filter for camera lens model.

Add a search filter next to the camera make to also allow filtering by
camera lens model. Update backend to support this. Add a test similar
to the other tests.
This commit is contained in:
Dag Stuan 2025-09-10 21:21:06 +02:00
parent 6a55c36762
commit 92b1c43c00
12 changed files with 133 additions and 15 deletions

View file

@ -123,12 +123,14 @@ class SearchApi {
/// * [bool] includeNull:
/// This property was added in v111.0.0
///
/// * [String] lensModel:
///
/// * [String] make:
///
/// * [String] model:
///
/// * [String] state:
Future<Response> getSearchSuggestionsWithHttpInfo(SearchSuggestionType type, { String? country, bool? includeNull, String? make, String? model, String? state, }) async {
Future<Response> getSearchSuggestionsWithHttpInfo(SearchSuggestionType type, { String? country, bool? includeNull, String? lensModel, String? make, String? model, String? state, }) async {
// ignore: prefer_const_declarations
final apiPath = r'/search/suggestions';
@ -145,6 +147,9 @@ class SearchApi {
if (includeNull != null) {
queryParams.addAll(_queryParams('', 'includeNull', includeNull));
}
if (lensModel != null) {
queryParams.addAll(_queryParams('', 'lensModel', lensModel));
}
if (make != null) {
queryParams.addAll(_queryParams('', 'make', make));
}
@ -181,13 +186,15 @@ class SearchApi {
/// * [bool] includeNull:
/// This property was added in v111.0.0
///
/// * [String] lensModel:
///
/// * [String] make:
///
/// * [String] model:
///
/// * [String] state:
Future<List<String>?> getSearchSuggestions(SearchSuggestionType type, { String? country, bool? includeNull, String? make, String? model, String? state, }) async {
final response = await getSearchSuggestionsWithHttpInfo(type, country: country, includeNull: includeNull, make: make, model: model, state: state, );
Future<List<String>?> getSearchSuggestions(SearchSuggestionType type, { String? country, bool? includeNull, String? lensModel, String? make, String? model, String? state, }) async {
final response = await getSearchSuggestionsWithHttpInfo(type, country: country, includeNull: includeNull, lensModel: lensModel, make: make, model: model, state: state, );
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}