deleteIndex method

Future deleteIndex()

DeleteIndex

Delete the index referred to by this AlgoliaIndexReference.

Implementation

Future deleteIndex() async {
  assert(index != null, 'You can\'t clear an objects without an indexName.');
  try {
    String url = '${algolia._host}indexes/$index';
    Response response = await delete(
      Uri.parse(url),
      headers: algolia._header,
    );
    Map<String, dynamic> body = json.decode(response.body);
    return AlgoliaTask._(algolia, index, body);
  } catch (err) {
    return err;
  }
}