removeData method

  1. @override
Future<void> removeData(
  1. String collectionId,
  2. String mid
)
override

Implementation

@override
Future<void> removeData(String collectionId, String mid) async {
  await initialize();
  try {
    String key = HycopUtils.midToKey(mid);
    await database!.deleteDocument(
      databaseId: myConfig!.serverConfig.dbConnInfo.appId,
      collectionId: collectionId,
      documentId: key,
    );
  } on AppwriteException catch (e) {
    if (e.code == 404) {
      logger.finest(e.message!);
      return;
    }
    if (e.message != null) {
      throw HycopException(message: e.message!, code: e.code);
    }
    throw HycopException(message: 'Appwrite error', code: e.code);
  }
}