mirror of
https://github.com/discourse/discourse.git
synced 2024-12-15 22:52:10 +08:00
d9a02d1336
This reverts commit20780a1eee
. * SECURITY: re-adds accidentally reverted commit: 03d26cd6: ensure embed_url contains valid http(s) uri * when the merge commite62a85cf
was reverted, git chose the2660c2e2
parent to land on instead of the03d26cd6
parent (which contains security fixes)
31 lines
882 B
JavaScript
31 lines
882 B
JavaScript
import { get } from "@ember/object";
|
|
import DiscourseRoute from "discourse/routes/discourse";
|
|
|
|
export default DiscourseRoute.extend({
|
|
serialize(model) {
|
|
return { web_hook_id: model.get("id") || "new" };
|
|
},
|
|
|
|
model(params) {
|
|
if (params.web_hook_id === "new") {
|
|
return this.store.createRecord("web-hook");
|
|
}
|
|
return this.store.find("web-hook", get(params, "web_hook_id"));
|
|
},
|
|
|
|
setupController(controller, model) {
|
|
if (model.get("isNew")) {
|
|
model.set("web_hook_event_types", controller.get("defaultEventTypes"));
|
|
}
|
|
|
|
model.set("category_ids", model.get("category_ids"));
|
|
model.set("tag_names", model.get("tag_names"));
|
|
model.set("group_ids", model.get("group_ids"));
|
|
controller.setProperties({ model, saved: false });
|
|
},
|
|
|
|
renderTemplate() {
|
|
this.render("admin/templates/web-hooks-show", { into: "adminApi" });
|
|
}
|
|
});
|