👽 Update the articles url to new
This commit is contained in:
@@ -10,7 +10,7 @@ final articleDetailProvider = FutureProvider.autoDispose
|
||||
|
||||
try {
|
||||
final response = await dio.get<Map<String, dynamic>>(
|
||||
'/sphere/feeds/articles/$articleId',
|
||||
'/insight/feeds/articles/$articleId',
|
||||
);
|
||||
|
||||
if (response.statusCode == 200 && response.data != null) {
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:island/pods/network.dart';
|
||||
final webFeedListProvider = FutureProvider.autoDispose
|
||||
.family<List<SnWebFeed>, String>((ref, pubName) async {
|
||||
final client = ref.watch(apiClientProvider);
|
||||
final response = await client.get('/sphere/publishers/$pubName/feeds');
|
||||
final response = await client.get('/insight/publishers/$pubName/feeds');
|
||||
return (response.data as List)
|
||||
.map((json) => SnWebFeed.fromJson(json))
|
||||
.toList();
|
||||
|
||||
@@ -42,7 +42,7 @@ class ArticlesListNotifier extends AsyncNotifier<PaginationState<SnWebArticle>>
|
||||
|
||||
try {
|
||||
final response = await client.get(
|
||||
'/sphere/feeds/articles',
|
||||
'/insight/feeds/articles',
|
||||
queryParameters: queryParams,
|
||||
);
|
||||
|
||||
@@ -98,7 +98,7 @@ class SliverArticlesList extends ConsumerWidget {
|
||||
@riverpod
|
||||
Future<List<SnWebFeed>> subscribedFeeds(Ref ref) async {
|
||||
final client = ref.watch(apiClientProvider);
|
||||
final response = await client.get('/sphere/feeds/subscribed');
|
||||
final response = await client.get('/insight/feeds/subscribed');
|
||||
final data = response.data as List<dynamic>;
|
||||
return data.map((json) => SnWebFeed.fromJson(json)).toList();
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ part 'feed_detail.g.dart';
|
||||
@riverpod
|
||||
Future<SnWebFeed> marketplaceWebFeed(Ref ref, String feedId) async {
|
||||
final apiClient = ref.watch(apiClientProvider);
|
||||
final resp = await apiClient.get('/sphere/feeds/$feedId');
|
||||
final resp = await apiClient.get('/insight/feeds/$feedId');
|
||||
return SnWebFeed.fromJson(resp.data);
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ class MarketplaceWebFeedContentNotifier
|
||||
final queryParams = {'offset': fetchedCount.toString(), 'take': pageSize};
|
||||
|
||||
final response = await client.get(
|
||||
'/sphere/feeds/$arg/articles',
|
||||
'/insight/feeds/$arg/articles',
|
||||
queryParameters: queryParams,
|
||||
);
|
||||
totalCount = int.parse(response.headers.value('X-Total') ?? '0');
|
||||
@@ -61,7 +61,7 @@ Future<bool> marketplaceWebFeedSubscription(
|
||||
}) async {
|
||||
final api = ref.watch(apiClientProvider);
|
||||
try {
|
||||
await api.get('/sphere/feeds/$feedId/subscription');
|
||||
await api.get('/insight/feeds/$feedId/subscription');
|
||||
// If not 404, consider subscribed
|
||||
return true;
|
||||
} on Object catch (e) {
|
||||
@@ -86,7 +86,7 @@ class MarketplaceWebFeedDetailScreen extends HookConsumerWidget {
|
||||
// Subscribe to web feed
|
||||
Future<void> subscribeToFeed() async {
|
||||
final apiClient = ref.watch(apiClientProvider);
|
||||
await apiClient.post('/sphere/feeds/$id/subscribe');
|
||||
await apiClient.post('/insight/feeds/$id/subscribe');
|
||||
HapticFeedback.selectionClick();
|
||||
ref.invalidate(marketplaceWebFeedSubscriptionProvider(feedId: id));
|
||||
if (!context.mounted) return;
|
||||
@@ -96,7 +96,7 @@ class MarketplaceWebFeedDetailScreen extends HookConsumerWidget {
|
||||
// Unsubscribe from web feed
|
||||
Future<void> unsubscribeFromFeed() async {
|
||||
final apiClient = ref.watch(apiClientProvider);
|
||||
await apiClient.delete('/sphere/feeds/$id/subscribe');
|
||||
await apiClient.delete('/insight/feeds/$id/subscribe');
|
||||
HapticFeedback.selectionClick();
|
||||
ref.invalidate(marketplaceWebFeedSubscriptionProvider(feedId: id));
|
||||
if (!context.mounted) return;
|
||||
|
||||
@@ -29,7 +29,7 @@ class MarketplaceWebFeedsNotifier
|
||||
final client = ref.read(apiClientProvider);
|
||||
|
||||
final response = await client.get(
|
||||
'/sphere/feeds/explore',
|
||||
'/insight/feeds/explore',
|
||||
queryParameters: {
|
||||
'offset': fetchedCount.toString(),
|
||||
'take': 20,
|
||||
|
||||
Reference in New Issue
Block a user