👽 Update service usage

This commit is contained in:
2025-09-17 00:48:01 +08:00
parent c64e1e208c
commit 313af28d7f
3 changed files with 5 additions and 5 deletions

View File

@@ -39,7 +39,7 @@ class NotificationUnreadCountNotifier
try { try {
final client = ref.read(apiClientProvider); final client = ref.read(apiClientProvider);
final response = await client.get('/pusher/notifications/count'); final response = await client.get('/ring/notifications/count');
return (response.data as num).toInt(); return (response.data as num).toInt();
} catch (_) { } catch (_) {
return 0; return 0;
@@ -89,7 +89,7 @@ class NotificationListNotifier extends _$NotificationListNotifier
final queryParams = {'offset': offset, 'take': _pageSize}; final queryParams = {'offset': offset, 'take': _pageSize};
final response = await client.get( final response = await client.get(
'/pusher/notifications', '/ring/notifications',
queryParameters: queryParams, queryParameters: queryParams,
); );
final total = int.parse(response.headers.value('X-Total') ?? '0'); final total = int.parse(response.headers.value('X-Total') ?? '0');
@@ -121,7 +121,7 @@ class NotificationScreen extends HookConsumerWidget {
Future<void> markAllRead() async { Future<void> markAllRead() async {
showLoadingModal(context); showLoadingModal(context);
final apiClient = ref.watch(apiClientProvider); final apiClient = ref.watch(apiClientProvider);
await apiClient.post('/pusher/notifications/all/read'); await apiClient.post('/ring/notifications/all/read');
if (!context.mounted) return; if (!context.mounted) return;
hideLoadingModal(context); hideLoadingModal(context);
ref.invalidate(notificationListNotifierProvider); ref.invalidate(notificationListNotifierProvider);

View File

@@ -226,7 +226,7 @@ Future<void> _putTokenToRemote(
int provider, int provider,
) async { ) async {
await apiClient.put( await apiClient.put(
"/pusher/notifications/subscription", "/ring/notifications/subscription",
data: {"provider": provider, "device_token": token}, data: {"provider": provider, "device_token": token},
); );
} }

View File

@@ -170,7 +170,7 @@ Future<void> _putTokenToRemote(
int provider, int provider,
) async { ) async {
await apiClient.put( await apiClient.put(
"/pusher/notifications/subscription", "/ring/notifications/subscription",
data: {"provider": provider, "device_token": token}, data: {"provider": provider, "device_token": token},
); );
} }