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

22 lines
556 B
JavaScript
Raw Normal View History

import DiscourseRoute from "discourse/routes/discourse";
2022-03-06 13:52:19 -05:00
import EmberObject from "@ember/object";
2020-09-04 07:24:14 -04:00
import I18n from "I18n";
export default DiscourseRoute.extend({
model(params) {
if (params.ad_id === "new") {
2022-03-06 13:52:19 -05:00
return EmberObject.create({
name: I18n.t("admin.adplugin.house_ads.new_name"),
2020-09-04 07:24:14 -04:00
html: "",
visible_to_logged_in_users: true,
visible_to_anons: true,
});
} else {
return this.modelFor("adminPlugins.houseAds").findBy(
"id",
parseInt(params.ad_id, 10)
);
}
2020-09-04 07:24:14 -04:00
},
});