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