discourse-adplugin/assets/javascripts/discourse/routes/admin-plugins-house-ads.js

22 lines
567 B
JavaScript
Raw Normal View History

import { ajax } from "discourse/lib/ajax";
import DiscourseRoute from "discourse/routes/discourse";
export default DiscourseRoute.extend({
settings: null,
2019-06-14 12:10:11 -04:00
model() {
2020-09-04 07:24:14 -04:00
return ajax("/admin/plugins/pluginad/house_creatives.json").then((data) => {
this.set("settings", Ember.Object.create(data.settings));
2020-09-04 07:24:14 -04:00
return data.house_ads.map((ad) => Ember.Object.create(ad));
});
},
setupController(controller, model) {
controller.setProperties({
model,
houseAdsSettings: this.get("settings"),
2020-09-04 07:24:14 -04:00
loadingAds: false,
});
2020-09-04 07:24:14 -04:00
},
});