Insert Conv only if message was success

This commit is contained in:
2025-08-12 10:33:25 +02:00
parent e8954f73ed
commit ee04279319

View File

@@ -124,6 +124,8 @@ namespace BeWo.Service.Plugins
var conv = createAiConversation(conversation.UIContext, conversation.ContextBeWoObjects, modell_oid, config.Context_Type);
DAOFactory.GenericDAO.Insert(conv);
var conv_dc = MapperFactory.AiConversation.MapToNewDC(conv);
return conv_dc;
@@ -136,6 +138,8 @@ namespace BeWo.Service.Plugins
var new_messages = sendNewMessage(conv, message, config);
DAOFactory.GenericDAO.Insert(conv);
var conv_dc = MapperFactory.AiConversation.MapToNewDC(conv);
return conv_dc;
@@ -287,8 +291,6 @@ namespace BeWo.Service.Plugins
conv.Messages.Add(msg);
DAOFactory.GenericDAO.Insert(conv);
return conv;
}