I am trying to save a sequelize instance into a variable before update. But after updating, the old variable is also updated into the new sequelize instance, which makes the .description of the variable 'oldRequest' before and after different.
var oldRequest = request; // HUGE BUG HERE, OLD REQUEST IS ALSO MODIFIED AS REQUEST IS MODIFIED
console.log("before " + oldRequest.description);
attributes.lastUpdater = req.user.get('firstName') + " " + req.user.get('lastName');
request.update(attributes).then(function(updatedRequest) {
console.log("after " + oldRequest.description);
send_update_email(oldRequest ,updatedRequest, req.user.get('email')).then(function() {