forked from eatvio/eatvio_app
28 lines
822 B
Dart
28 lines
822 B
Dart
import 'dart:developer';
|
|
import 'package:eatvio_app/features/notifications/service/notifications_service.dart';
|
|
import 'package:sentry_flutter/sentry_flutter.dart';
|
|
|
|
class NotificationsRepository {
|
|
final NotificationsService notificationsService;
|
|
NotificationsRepository({required this.notificationsService});
|
|
|
|
Future<Map<String, dynamic>?> getNotifications({required int page}) async {
|
|
try {
|
|
return await notificationsService.getNotifications(page: page);
|
|
} catch (e, s) {
|
|
log(e.toString());
|
|
await Sentry.captureException(e, stackTrace: s);
|
|
rethrow;
|
|
}
|
|
}
|
|
|
|
Future<void> markNotificationsAsRead() async {
|
|
try {
|
|
await notificationsService.markNotificationsAsRead();
|
|
} catch (e, s) {
|
|
await Sentry.captureException(e, stackTrace: s);
|
|
rethrow;
|
|
}
|
|
}
|
|
}
|