Skip to content

Commit

Permalink
Use URI in the MoviesRepository
Browse files Browse the repository at this point in the history
  • Loading branch information
bizz84 committed Apr 12, 2024
1 parent f5a52ca commit a3c43a1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/src/features/movies/data/movies_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class MoviesRepository {

Future<TMDBMoviesResponse> searchMovies(
{required MoviesQueryData queryData, CancelToken? cancelToken}) async {
final url = Uri(
final uri = Uri(
scheme: 'https',
host: 'api.themoviedb.org',
path: '3/search/movie',
Expand All @@ -29,14 +29,14 @@ class MoviesRepository {
'page': '${queryData.page}',
'query': queryData.query,
},
).toString();
final response = await client.get(url, cancelToken: cancelToken);
);
final response = await client.getUri(uri, cancelToken: cancelToken);
return TMDBMoviesResponse.fromJson(response.data);
}

Future<TMDBMoviesResponse> nowPlayingMovies(
{required int page, CancelToken? cancelToken}) async {
final url = Uri(
final uri = Uri(
scheme: 'https',
host: 'api.themoviedb.org',
path: '3/movie/now_playing',
Expand All @@ -45,8 +45,8 @@ class MoviesRepository {
'include_adult': 'false',
'page': '$page',
},
).toString();
final response = await client.get(url, cancelToken: cancelToken);
);
final response = await client.getUri(uri, cancelToken: cancelToken);
return TMDBMoviesResponse.fromJson(response.data);
}

Expand Down

0 comments on commit a3c43a1

Please sign in to comment.