Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
submitCallback: function (data) {
var changedAttributes = _.compactObject(self.model.changedAttributes(data))
if (data['payment.price'] || data['payment.date'] || data['payment.invoice'] || data['payment.status'] || data['payment.via']) {
data.payment = {
price: data['payment.price'] || self.model.payment && self.model.payment.price,
date: data['payment.date'] || self.model.payment && self.model.payment.date,
invoice: data['payment.invoice'] || self.model.payment && self.model.payment.invoice,
status: data['payment.status'] || self.model.payment && self.model.payment.status,
via: data['payment.via'] || self.model.payment && self.model.payment.via
}
delete data['payment.price']
delete data['payment.date']
delete data['payment.invoice']
delete data['payment.status']
delete data['payment.via']
if (!changedAttributes) {
changedAttributes = {}
}
changedAttributes.payment = data.payment
}
log('data', data, changedAttributes)
if (!changedAttributes) {
return self.parent.handleViewClick()
}
submitCallback: function (data) {
var changedAttributes = _.compactObject(self.model.changedAttributes(data))
if (data['payment.price'] || data['payment.date'] || data['payment.invoice'] || data['payment.status'] || data['payment.via']) {
data.payment = {
price: data['payment.price'] || self.model.payment && self.model.payment.price,
date: data['payment.date'] || self.model.payment && self.model.payment.date,
invoice: data['payment.invoice'] || self.model.payment && self.model.payment.invoice,
status: data['payment.status'] || self.model.payment && self.model.payment.status,
via: data['payment.via'] || self.model.payment && self.model.payment.via
}
delete data['payment.price']
delete data['payment.date']
delete data['payment.invoice']
delete data['payment.status']
delete data['payment.via']
if (!changedAttributes) {
changedAttributes = {}
}
changedAttributes.payment = data.payment
}