fetch method

  1. @override
Future<DfResponse> fetch(
  1. DfQuery query
)
override

Implementation

@override
Future<DfResponse> fetch(DfQuery query) async {
  List<DfQuery> queries = _convertSyncQueryToNativeQueries(query);
  DfQuery dbQuery = queries[0];
  DfQuery webQuery = queries[1];

  DfResponse resp;
  if (model.webRepository != null) {
    resp = await model.webRepository.fetch(webQuery);
  }
  if ((resp == null || resp.error != null) && model.dbRepository != null) {
    DfError webError = resp.error;
    resp = await model.dbRepository.fetch(dbQuery);
    resp.onlineSyncError = webError;
  }
  return resp;
}