diff --git a/src/files/client/custom/modules/real-estate/src/views/real-estate-property/list-matching.js b/src/files/client/custom/modules/real-estate/src/views/real-estate-property/list-matching.js index a97d1cb..c9f7287 100644 --- a/src/files/client/custom/modules/real-estate/src/views/real-estate-property/list-matching.js +++ b/src/files/client/custom/modules/real-estate/src/views/real-estate-property/list-matching.js @@ -26,7 +26,9 @@ * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ -Espo.define('real-estate:views/real-estate-property/list-matching', ['views/main', 'search-manager', 'real-estate:views/real-estate-property/record/panels/matching-requests'], function (Dep, SearchManager, Panel) { +define('real-estate:views/real-estate-property/list-matching', +['views/main', 'search-manager', 'real-estate:views/real-estate-property/record/panels/matching-requests'], +function (Dep, SearchManager, Panel) { return Dep.extend({ @@ -55,20 +57,20 @@ Espo.define('real-estate:views/real-estate-property/list-matching', ['views/main var countLoaded = 0; var proceed = function () { - if (countLoaded == 2) { + if (countLoaded === 2) { this.wait(false); } }.bind(this); - this.getModelFactory().create('RealEstateProperty', function (model) { + this.getModelFactory().create('RealEstateProperty', (model) => { this.model = model; model.id = this.options.id; - this.model.fetch().done(function () { + this.model.fetch().then(() => { countLoaded++; proceed(); - }.bind(this)); - }, this); + }); + }); this.getCollectionFactory().create('RealEstateRequest', function (collection) { this.collection = collection; @@ -204,4 +206,3 @@ Espo.define('real-estate:views/real-estate-property/list-matching', ['views/main }); }); - diff --git a/src/files/client/custom/modules/real-estate/src/views/real-estate-request/list-matching.js b/src/files/client/custom/modules/real-estate/src/views/real-estate-request/list-matching.js index e3fdde9..c7067a3 100644 --- a/src/files/client/custom/modules/real-estate/src/views/real-estate-request/list-matching.js +++ b/src/files/client/custom/modules/real-estate/src/views/real-estate-request/list-matching.js @@ -64,7 +64,7 @@ Espo.define('real-estate:views/real-estate-request/list-matching', ['views/main' this.model = model; model.id = this.options.id; - this.model.fetch().done(function () { + this.model.fetch().then(function () { countLoaded++; proceed(); }.bind(this));