filterContactsBy method

Future<DecryptedPaginatedListContactDto?> filterContactsBy(
  1. UserDto user,
  2. FilterChain<ContactDto> filterChain,
  3. String? startKey,
  4. String? startDocumentId,
  5. int? limit,
  6. CryptoConfig<DecryptedContactDto, ContactDto> config,
)

Implementation

Future<DecryptedPaginatedListContactDto?> filterContactsBy(UserDto user, FilterChain<ContactDto> filterChain, String? startKey, String? startDocumentId,
    int? limit, CryptoConfig<DecryptedContactDto, ContactDto> config) async {
  return await (await this.rawFilterContactsBy(filterChain, startDocumentId: startDocumentId, limit: limit))?.let((it) async =>
      DecryptedPaginatedListContactDto(
          rows: await Future.wait(it.rows.map((it) => config.decryptContact(user.dataOwnerId()!, it))),
          pageSize: it.pageSize,
          totalSize: it.totalSize,
          nextKeyPair: it.nextKeyPair));
}