0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-26 11:00:28 +01:00

Create CW-version of site singleton

Dieser Commit ist enthalten in:
Angus McLeod 2020-06-22 10:13:10 +10:00
Ursprung 454872edc8
Commit 841923b79c
2 geänderte Dateien mit 11 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -23,7 +23,7 @@ export default {
const Store = requirejs("discourse/models/store").default; const Store = requirejs("discourse/models/store").default;
const registerRawHelpers = requirejs("discourse-common/lib/raw-handlebars-helpers").registerRawHelpers; const registerRawHelpers = requirejs("discourse-common/lib/raw-handlebars-helpers").registerRawHelpers;
const RawHandlebars = requirejs("discourse-common/lib/raw-handlebars").default; const RawHandlebars = requirejs("discourse-common/lib/raw-handlebars").default;
const Site = requirejs("discourse/models/site").default; const Site = requirejs("discourse/plugins/discourse-custom-wizard/wizard/models/site").default;
const RestAdapter = requirejs("discourse/adapters/rest").default; const RestAdapter = requirejs("discourse/adapters/rest").default;
Discourse.Model = EmberObject.extend(); Discourse.Model = EmberObject.extend();

Datei anzeigen

@ -0,0 +1,10 @@
import Site from "discourse/models/site";
export default Site.reopenClass({
// There is no site data actually loaded by the CW yet. This placeholder is
// needed by imported classes
createCurrent() {
const store = Discourse.__container__.lookup("service:store");
return store.createRecord("site", {});
},
})