deleteCategory method

  1. @action
Future<bool> deleteCategory(
  1. CategoryWeebi data
)

Implementation

@action
Future<bool> deleteCategory(CategoryWeebi data) async {
  await _deleteCategoryServer(data);
  await _articlesService.deleteCategoryRpc.request(data);
  final indexCategory = categories.indexWhere((e) =>
      e.creationDate.toIso8601String() ==
      data.creationDate.toIso8601String());
  if (indexCategory != -1) {
    categories.removeAt(indexCategory);
    _categories.removeAt(indexCategory);
    return true;
  } else {
    return false;
  }
}