saveFact method
Implementation
Future<IFact> saveFact(IFact fact) async {
try {
// if (fact.factSchema.links.any((link) => link.path == contactKeyPath)) {
// fact.contactKey = contact.mkey;
// }
fact.dateCreated = DateTime.now();
IFact updated;
if (fact.id == null) {
updated = await _factApi.create(fact);
} else {
await _factApi.update(fact.id!, fact);
updated = fact;
}
_updatedFactController.add(updated);
return updated;
} catch (e) {
log.info(e);
rethrow;
}
}