deleteDoc<T extends YustDoc> method

Future<void> deleteDoc<T extends YustDoc>(
  1. YustDocSetup<T> docSetup,
  2. T doc
)

Delete a YustDoc.

Implementation

Future<void> deleteDoc<T extends YustDoc>(
  YustDocSetup<T> docSetup,
  T doc,
) async {
  await doc.onDelete();
  final docPath = _getDocumentPath(docSetup, doc.id);
  await _retryOnException('deleteDoc', _getDocumentPath(docSetup), () async {
    await _api.projects.databases.documents.delete(docPath);
    dbLogCallback?.call(
        DatabaseLogAction.delete, _getDocumentPath(docSetup), 1);
  });
}