findSyncs method
Returns a filtered FindSyncsResponse
with a list of syncs
type
: The target typetarget
: The targetstatus
: A list of statuscreatedBefore
: Syncs created before this dateupdatedBefore
: Syncs updated before this date
Upon success a list of Sync
objects is provided as well as the overall
number of records in total (not the number of syncs in the list, the
number of total results). The error is set to null
In case of error a ResponseError
is set and no Sync
list is provided
Implementation
@override
Future<FindSyncsResponse> findSyncs(
{SyncType? type,
String? target,
Set<SyncStatus>? status,
DateTime? createdBefore,
DateTime? updatedBefore}) {
return catchSqlError<FindSyncsResponse>(
store.syncDao
.find(
type: type,
target: target,
status: status,
createdBefore: createdBefore,
updatedBefore: updatedBefore)
.then((results) => FindSyncsResponse(
syncs: results
.map((sync) => FindSyncResponse(sync: sync))
.toList())),
(sqle) => FindSyncsResponse(
error: toResponseError(sqle, context: contextSync)),
options);
}