From bf35928a14e8cc152cc3266faf661cfd0f13de57 Mon Sep 17 00:00:00 2001 From: Daniel Waterworth Date: Tue, 26 Mar 2024 11:16:07 -0500 Subject: [PATCH] DEV: Set category on embeddable-host component instead of rest object (#26374) The rest object doesn't need the whole serialized category. --- .../javascripts/admin/addon/components/embeddable-host.hbs | 2 +- .../javascripts/admin/addon/components/embeddable-host.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/admin/addon/components/embeddable-host.hbs b/app/assets/javascripts/admin/addon/components/embeddable-host.hbs index 4e67cb1b50c..3d28b97cfd6 100644 --- a/app/assets/javascripts/admin/addon/components/embeddable-host.hbs +++ b/app/assets/javascripts/admin/addon/components/embeddable-host.hbs @@ -53,7 +53,7 @@
{{i18n "admin.embedding.category"}}
- {{category-badge this.host.category allowUncategorized=true}} + {{category-badge this.category allowUncategorized=true}} diff --git a/app/assets/javascripts/admin/addon/components/embeddable-host.js b/app/assets/javascripts/admin/addon/components/embeddable-host.js index a75e62af130..76fe26a95a5 100644 --- a/app/assets/javascripts/admin/addon/components/embeddable-host.js +++ b/app/assets/javascripts/admin/addon/components/embeddable-host.js @@ -28,7 +28,7 @@ export default class EmbeddableHost extends Component.extend( const categoryId = host.category_id || this.site.uncategorized_category_id; const category = Category.findById(categoryId); - host.set("category", category); + this.set("category", category); } @discourseComputed("buffered.host", "host.isSaving") @@ -60,7 +60,7 @@ export default class EmbeddableHost extends Component.extend( host .save(props) .then(() => { - host.set("category", Category.findById(this.categoryId)); + this.set("category", Category.findById(this.categoryId)); this.set("editToggled", false); }) .catch(popupAjaxError);