create address fixed

This commit is contained in:
Daniel Herrero 2018-02-08 12:57:57 +01:00
parent 013880cb0a
commit d0432140d7
2 changed files with 5 additions and 2 deletions

View File

@ -3,9 +3,10 @@
url="/client/api/Addresses"
id-field="id"
data="$ctrl.address"
save="post"
form="form">
</vn-watcher>
<form name="form" ng-submit="watcher.submitGo('clientCard.addresses')" pad-medium>
<form name="form" ng-submit="watcher.submitGo('clientCard.addresses.list')" pad-medium>
<vn-card >
<vn-vertical pad-large>
<vn-title>Address</vn-title>

View File

@ -94,7 +94,9 @@ export default class Watcher extends Component {
(resolve, reject) => this.noChanges(reject)
);
}
let changedData = (this.$attrs.save && this.$attrs.save.toLowerCase() === 'post') ? this.copyInNewObject(this.data) : getModifiedData(this.data, this.orgData);
let changedData = (this.$attrs.save && this.$attrs.save.toLowerCase() === 'post')
? this.copyInNewObject(this.data)
: getModifiedData(this.data, this.orgData);
if (this.save && this.save.accept) {
this.save.model = changedData; // this.copyInNewObject(changedData);