diff --git a/src/html/js/entries.js b/src/html/js/entries.js index 78610a9..92c80d8 100644 --- a/src/html/js/entries.js +++ b/src/html/js/entries.js @@ -1,14 +1,14 @@ // Entry object -function entry(data){ - this.id=ko.observable(ko.utils.unwrapObservable(data.id)); - this.value_date=ko.observable(ko.utils.unwrapObservable(data.value_date)); - this.operation_date=ko.observable(ko.utils.unwrapObservable(data.operation_date)); - this.label=ko.observable(ko.utils.unwrapObservable(data.label)); - this.value=ko.observable(ko.utils.unwrapObservable(data.value)); - this.account_id=ko.observable(ko.utils.unwrapObservable(data.account_id)); - this.sold=ko.observable(ko.utils.unwrapObservable(data.sold)); - this.pointedsold=ko.observable(ko.utils.unwrapObservable(data.pointedsold)); - this.category=ko.observable(ko.utils.unwrapObservable(data.category)); +function entry(){ + this.id=ko.observable(); + this.value_date=ko.observable(); + this.operation_date=ko.observable(); + this.label=ko.observable(); + this.value=ko.observable(); + this.account_id=ko.observable(); + this.sold=ko.observable(); + this.pointedsold=ko.observable(); + this.category=ko.observable(); } // Util function to show a message in message placeholder. @@ -212,9 +212,8 @@ var ListViewModel = function() { }; self.add = function() { - var newEntry = new entry({ - account_id: self.account().id - }); + var newEntry = new entry(); + newEntry.account_id(self.account().id); self.entries.unshift(newEntry);