deleteDocument method

Future<bool> deleteDocument(
  1. String collection,
  2. String documentId
)

Implementation

Future<bool> deleteDocument(String collection, String documentId) async {
  try {
    _loggingService.log('FirestoreGenericService.deleteDocument: Deleting. Collection $collection, DocId: $documentId');
    await _firebaseFirestore.collection(collection).doc(documentId).delete();
    _loggingService.log('FirestoreGenericService.deleteDocument: Deleted. Collection $collection, DocId: $documentId');
    return true;
  } catch (e) {
    _loggingService.log(
      'FirestoreGenericService.deleteDocument: Exception: $e',
      logType: LogType.error,
    );
    return false;
  }
}