getEntries method

Future<List<OpLogEntry<UserActionModel>>> getEntries(
  1. String clientReferenceId,
  2. DataOperation operation
)
inherited

Implementation

Future<List<OpLogEntry<T>>> getEntries(
  String clientReferenceId,
  DataOperation operation,
) async {
  final oplog = isar.opLogs
      .filter()
      .operationEqualTo(operation)
      .clientReferenceIdEqualTo(clientReferenceId)
      .findAllSync();

  if (oplog.isEmpty) {
    throw AppException('OpLog not found for id: $clientReferenceId');
  }

  return oplog.map((e) => OpLogEntry.fromOpLog<T>(e)).toList();
}