From 6296554ed1bc889b3cc30dfdbc2b9b0c59af294c Mon Sep 17 00:00:00 2001 From: David Taylor Date: Thu, 28 Feb 2019 10:48:30 +0000 Subject: [PATCH] DEV: Add additional hook for theme-creator --- .../admin/controllers/modals/admin-install-theme.js.es6 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/admin/controllers/modals/admin-install-theme.js.es6 b/app/assets/javascripts/admin/controllers/modals/admin-install-theme.js.es6 index 215f282ad8f..d1e9fc71a3f 100644 --- a/app/assets/javascripts/admin/controllers/modals/admin-install-theme.js.es6 +++ b/app/assets/javascripts/admin/controllers/modals/admin-install-theme.js.es6 @@ -114,6 +114,7 @@ export default Ember.Controller.extend(ModalFunctionality, { loading: false, keyGenUrl: "/admin/themes/generate_key_pair", importUrl: "/admin/themes/import", + recordType: "theme", checkPrivate: Ember.computed.match("uploadUrl", /^git/), localFile: null, uploadUrl: null, @@ -229,7 +230,7 @@ export default Ember.Controller.extend(ModalFunctionality, { installTheme() { if (this.get("create")) { this.set("loading", true); - const theme = this.store.createRecord("theme"); + const theme = this.store.createRecord(this.get("recordType")); theme .save({ name: this.get("name"), component: this.get("component") }) .then(() => { @@ -272,7 +273,10 @@ export default Ember.Controller.extend(ModalFunctionality, { this.set("loading", true); ajax(this.get("importUrl"), options) .then(result => { - const theme = this.store.createRecord("theme", result.theme); + const theme = this.store.createRecord( + this.get("recordType"), + result.theme + ); this.get("adminCustomizeThemes").send("addTheme", theme); this.send("closeModal"); })