getResults function

Future getResults(
  1. dynamic endpoint,
  2. dynamic options
)

Implementation

Future<dynamic> getResults(endpoint, options) async {
  try {
    var response = await getEndpoint(endpoint: endpoint, options: options);
    if (options is int || options is List<int>) {
      return response;
    }
    return response['results'];
  } on ArgumentError {
    rethrow;
  } catch (e) {
    return [];
  }
}