fix note collection

This commit is contained in:
yuri
2018-11-28 17:25:49 +02:00
parent 5c14eda02a
commit c9bb6dfdde
+14
View File
@@ -29,6 +29,20 @@ Espo.define('collections/note', 'collection', function (Dep) {
return Dep.extend({
parse: function (response, params) {
var total = this.total;
var list = Dep.prototype.parse.call(this, response, params);
if (params.data && params.data.after) {
if (total >= 0 && response.total >= 0) {
this.total = total + response.total;
} else {
this.total = total;
}
}
return list;
},
fetchNew: function (options) {
var options = options || {};
options.data = options.data || {};