From 9ea9f40d186c39bae41d75437e8ae37145a12464 Mon Sep 17 00:00:00 2001 From: Jonas Cosandey Date: Mon, 12 Apr 2021 08:47:19 +0200 Subject: [PATCH] refactor(gwr service): use constructor instead of init --- addon/services/gwr.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/addon/services/gwr.js b/addon/services/gwr.js index 3a5cfeef..2c99e357 100644 --- a/addon/services/gwr.js +++ b/addon/services/gwr.js @@ -17,6 +17,11 @@ export default class GwrService extends Service { _cache = {}; + constructor(...args) { + super(...args); + this._setupHandlebarsPartials(); + } + createAndCacheProject(xml) { const project = new ConstructionProject(xml); this._cache[project.EPROID] = project; @@ -177,11 +182,6 @@ export default class GwrService extends Service { _hbs = Handlebars; _compiledTemplates = {}; - init(...args) { - super.init(...args); - this._setupHandlebarsPartials(); - } - _buildXMLRequest(type, model, reason = "Modification enregistrement") { // Compile the needed templates on the fly so only // the ones used are compiled to remove a bit of over head.