createDialogEntity static method
Implementation
static Future<DialogEntity> createDialogEntity(
dynamic dialog,
String appId, {
Feedback? feedback,
}) async {
var documentID = dialog['documentID'];
dialog['appId'] = appId;
var dialogEntity = DialogEntity.fromMap(dialog);
if (dialogEntity != null) {
var newDialogEntity = await dialogRepository(appId: appId)!
.addEntity(documentID, dialogEntity);
if (feedback != null) {
feedback(JsonConsts.dialogs, documentID);
}
return newDialogEntity;
} else {
throw Exception('Can not create dialogEntity');
}
}