1
0
mirror of https://github.com/immich-app/immich.git synced 2025-06-16 03:40:33 +02:00

fix(server): "view all" for cities only showing 12 cities (#8035)

* view all cities

* increase limit

* rename endpoint

* optimize query

* remove pagination

* update sql

* linting

* revert sort by count in explore page for now

* fix query

* fix

* update sql

* move to search, add partner support

* update sql

* pr feedback

* euphemism

* parameters as separate variable

* move comment

* update sql

* linting
This commit is contained in:
Mert
2024-03-19 23:23:57 -04:00
committed by GitHub
parent 2daed747cd
commit f392fe7702
14 changed files with 358 additions and 32 deletions

View File

@ -16,6 +16,50 @@ class SearchApi {
final ApiClient apiClient;
/// Performs an HTTP 'GET /search/cities' operation and returns the [Response].
Future<Response> getAssetsByCityWithHttpInfo() async {
// ignore: prefer_const_declarations
final path = r'/search/cities';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
Future<List<AssetResponseDto>?> getAssetsByCity() async {
final response = await getAssetsByCityWithHttpInfo();
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
.cast<AssetResponseDto>()
.toList(growable: false);
}
return null;
}
/// Performs an HTTP 'GET /search/explore' operation and returns the [Response].
Future<Response> getExploreDataWithHttpInfo() async {
// ignore: prefer_const_declarations