updateNotification method
- Notification notification
override
Updates a notification by posting the updated notification
to the server.
Returns the updated notification from the server.
Implementation
@override
Future<Notification> updateNotification(Notification notification) async {
final response = await apiService.callFunction(
function: "local_lbplanner_notifications_update_notification",
token: token.lbPlannerApiToken,
body: {
"notificationid": notification.id,
"status": notification.readAsInt,
},
);
if (response.failed) {
throw Exception(
"Failed to update notification with status code ${response.statusCode}",
);
}
final json = response.expectSingle();
return Notification.fromJson(json);
}