ДЕПРЕССИЯ поиск не работает

This commit is contained in:
kamilia 2024-11-14 15:05:27 +04:00
parent 1c7eb9525f
commit 58c5958c33

View File

@ -22,15 +22,10 @@ class SwRepository extends ApiInterface {
int pageSize = 10,
}) async {
try {
const String url = '$_baseUrl/characters';
final String searchQuery = q ?? '';
final String url = '$_baseUrl/characters/name/$searchQuery';
final Response<dynamic> response = await _dio.get<Map<dynamic, dynamic>>(
url,
queryParameters: {
'name': q,
'page': page
}
);
final Response<dynamic> response = await _dio.get<Map<dynamic, dynamic>>(url);
final CharactersDto dto = CharactersDto.fromJson(response.data as Map<String, dynamic>);
final HomeData data = dto.toDomain();