sending flow object to backend

This commit is contained in:
anovazzi1 2023-02-23 15:00:39 -03:00
commit ad7e975310

View file

@ -108,11 +108,7 @@ export default function Chat({ reactFlowInstance }) {
let message = chatValue;
setChatValue("");
addChatHistory(message, true);
sendAll({
message,
nodes: JSON.stringify(reactFlowInstance.getNodes()),
edges: JSON.stringify(reactFlowInstance.getEdges()),
}).then((r) => {addChatHistory(r.data.messsage, false);});
sendAll({...reactFlowInstance.toObject(),message}).then((r) => {addChatHistory(r.data.messsage, false);});
} else {
setErrorData({title: 'Error sending message', list:['Chat nodes are missing.']})
}