fetchNotifications method
override
Fetches all notifications for the currently logged in user.
Implementation
@override
Future<List<Notification>> fetchNotifications() async {
final response = await apiService.callFunction(
function: "local_lbplanner_notifications_get_all_notifications",
token: token.lbPlannerApiToken,
body: {},
);
if (response.failed) {
throw Exception(
"Failed to fetch notifications with status code ${response.statusCode}",
);
}
final json = response.expectMultiple();
return json.map((e) => Notification.fromJson(e)).toList();
}