getPendingDownSync method
Future<List<OpLogEntry<HFReferralModel> > >
getPendingDownSync(
- DataModelType type, {
- required String createdBy,
inherited
Implementation
Future<List<OpLogEntry<T>>> getPendingDownSync(
DataModelType type, {
required String createdBy,
}) async {
var oplogs = isar.opLogs
.filter()
.syncedUpEqualTo(true)
.syncDownRetryCountLessThan(
DigitDataModelSingleton().syncDownRetryCount)
.syncedDownEqualTo(false)
.entityTypeEqualTo(type)
.findAllSync();
oplogs = oplogs
.sortedBy((element) => element.createdAt)
.where(
(element) =>
element.entityType != DataModelType.service &&
element.entityType != DataModelType.userLocation &&
element.entityType != DataModelType.complaints,
// Added service so that we don't get the response from the server
)
.toList();
return oplogs.map((e) => OpLogEntry.fromOpLog<T>(e)).toList();
}