ДЕПРЕССИЯ поиск не работает
This commit is contained in:
parent
1c7eb9525f
commit
58c5958c33
@ -22,15 +22,10 @@ class SwRepository extends ApiInterface {
|
|||||||
int pageSize = 10,
|
int pageSize = 10,
|
||||||
}) async {
|
}) async {
|
||||||
try {
|
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>>(
|
final Response<dynamic> response = await _dio.get<Map<dynamic, dynamic>>(url);
|
||||||
url,
|
|
||||||
queryParameters: {
|
|
||||||
'name': q,
|
|
||||||
'page': page
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
final CharactersDto dto = CharactersDto.fromJson(response.data as Map<String, dynamic>);
|
final CharactersDto dto = CharactersDto.fromJson(response.data as Map<String, dynamic>);
|
||||||
final HomeData data = dto.toDomain();
|
final HomeData data = dto.toDomain();
|
||||||
|
Loading…
Reference in New Issue
Block a user