|
|
|
@ -15,11 +15,10 @@ exports.createConnections = async (req, body) => {
|
|
|
|
|
var tankname = req.body.source;
|
|
|
|
|
|
|
|
|
|
const tankInfo = await Tank.findOne({ tankName: tankname.toString() })
|
|
|
|
|
const updateData = req.body;
|
|
|
|
|
console.log(updateData.inputConnections);
|
|
|
|
|
if (updateData.source) tankInfo.connections.source = updateData.source;
|
|
|
|
|
if (updateData.inputConnections) tankInfo.connections.inputConnections = updateData.inputConnections;
|
|
|
|
|
if (updateData.outputConnections) tankInfo.connections.outputConnections = updateData.outputConnections;
|
|
|
|
|
const usertobeInserted = req.body;
|
|
|
|
|
if (usertobeInserted.source) tankInfo.connections.source = usertobeInserted.source;
|
|
|
|
|
if (usertobeInserted.inputConnections) tankInfo.connections.inputConnections = usertobeInserted.inputConnections;
|
|
|
|
|
if (usertobeInserted.outputConnections) tankInfo.connections.outputConnections = usertobeInserted.outputConnections;
|
|
|
|
|
const tank_connections = await tankInfo.save();
|
|
|
|
|
return tank_connections;
|
|
|
|
|
} catch (err) {
|
|
|
|
|