archive method

  1. @override
Future<Either<Failure, Unit>> archive(
  1. AppNotification notification
)
override

Implementation

@override
Future<Either<Failure, Unit>> archive(AppNotification notification) async {
  return wrapAndHandleHttpBaseRequest<Unit>(
    () {
      final url = notificationConfig.archiveApiEndpoint!(notification);

      final Request request = Request(
        notificationConfig.archiveMethod ?? "POST",
        url,
      );
      return notificationConfig.archiveRequestMapper?.call(request, notification) ?? request;
    },
    onResponse: (response, left, right) {
      return right(unit);
    },
  );
}