|
|
@ -24,7 +24,6 @@ console.log(req.params);
|
|
|
|
// const updateData = req.body;
|
|
|
|
// const updateData = req.body;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// console.log("This is the reply in the handler after the validations", reply);
|
|
|
|
// console.log("This is the reply in the handler after the validations", reply);
|
|
|
|
tankersData = {
|
|
|
|
tankersData = {
|
|
|
|
customerId:customerId,
|
|
|
|
customerId:customerId,
|
|
|
@ -33,7 +32,7 @@ console.log(req.params);
|
|
|
|
typeofwater: req.body.typeofwater,
|
|
|
|
typeofwater: req.body.typeofwater,
|
|
|
|
capacity: req.body.capacity,
|
|
|
|
capacity: req.body.capacity,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
console.log(req.body.typeofwater,req.body.capacity)
|
|
|
|
|
|
|
|
|
|
|
|
var tanker_Name = req.body.tankerName
|
|
|
|
var tanker_Name = req.body.tankerName
|
|
|
|
var i_tank = await Tanker.findOne({ tankerName: tanker_Name,customerId:customerId})
|
|
|
|
var i_tank = await Tanker.findOne({ tankerName: tanker_Name,customerId:customerId})
|
|
|
@ -55,9 +54,9 @@ console.log(req.params);
|
|
|
|
tankers.customerId = usertobeInserted.customerId;
|
|
|
|
tankers.customerId = usertobeInserted.customerId;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const insertedTank = await tankers.save();
|
|
|
|
const insertedTanker = await tankers.save();
|
|
|
|
|
|
|
|
|
|
|
|
return insertedTank;
|
|
|
|
return insertedTanker;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (err) {
|
|
|
|
} catch (err) {
|
|
|
|