diff --git a/lib/config/constant_config.dart b/lib/config/constant_config.dart index 273aa87..4404823 100644 --- a/lib/config/constant_config.dart +++ b/lib/config/constant_config.dart @@ -1,3 +1,3 @@ class ConstantConfig { - final String apiKeyNewsApi = '3f1bdb0927c94f8da5708f7a36f7d06f'; + final String keyNewsApi = '3f1bdb0927c94f8da5708f7a36f7d06f'; } \ No newline at end of file diff --git a/lib/feature/data/datasource/news/news_remote_data_source.dart b/lib/feature/data/datasource/news/news_remote_data_source.dart index 1eb3bbf..b4ccc0b 100644 --- a/lib/feature/data/datasource/news/news_remote_data_source.dart +++ b/lib/feature/data/datasource/news/news_remote_data_source.dart @@ -32,7 +32,7 @@ class NewsRemoteDataSourceImpl implements NewsRemoteDataSource { '/v2/top-headlines', queryParameters: { 'country': 'id', - 'apiKey': constantConfig.apiKeyNewsApi, + 'apiKey': constantConfig.keyNewsApi, }, ); } else { @@ -40,7 +40,7 @@ class NewsRemoteDataSourceImpl implements NewsRemoteDataSource { '/v2/top-headlines', queryParameters: { 'country': 'id', - 'apiKey': constantConfig.apiKeyNewsApi, + 'apiKey': constantConfig.keyNewsApi, 'category': category, }, ); @@ -58,7 +58,7 @@ class NewsRemoteDataSourceImpl implements NewsRemoteDataSource { '/v2/top-headlines', queryParameters: { 'country': 'id', - 'apiKey': constantConfig.apiKeyNewsApi, + 'apiKey': constantConfig.keyNewsApi, 'q': keyword, }, ); diff --git a/test/feature/data/datasource/news/news_remote_data_source_test.dart b/test/feature/data/datasource/news/news_remote_data_source_test.dart index 40733e7..91e5a55 100644 --- a/test/feature/data/datasource/news/news_remote_data_source_test.dart +++ b/test/feature/data/datasource/news/news_remote_data_source_test.dart @@ -75,7 +75,7 @@ void main() { '/v2/top-headlines', queryParameters: { 'country': 'id', - 'apiKey': constantConfig.apiKeyNewsApi, + 'apiKey': constantConfig.keyNewsApi, }, ), ); @@ -98,7 +98,7 @@ void main() { queryParameters: { 'category': tCategory, 'country': 'id', - 'apiKey': constantConfig.apiKeyNewsApi, + 'apiKey': constantConfig.keyNewsApi, }, ), ); @@ -174,7 +174,7 @@ void main() { '/v2/top-headlines', queryParameters: { 'country': 'id', - 'apiKey': constantConfig.apiKeyNewsApi, + 'apiKey': constantConfig.keyNewsApi, 'q': tKeyword, }, ),