DEV: Set category on embeddable-host component instead of rest object (#26374)

The rest object doesn't need the whole serialized category.
This commit is contained in:
Daniel Waterworth 2024-03-26 11:16:07 -05:00 committed by GitHub
parent 312a5ead1f
commit bf35928a14
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -53,7 +53,7 @@
</td> </td>
<td> <td>
<div class="label">{{i18n "admin.embedding.category"}}</div> <div class="label">{{i18n "admin.embedding.category"}}</div>
{{category-badge this.host.category allowUncategorized=true}} {{category-badge this.category allowUncategorized=true}}
</td> </td>
<td class="controls"> <td class="controls">
<DButton @icon="pencil-alt" @action={{this.edit}} /> <DButton @icon="pencil-alt" @action={{this.edit}} />

View File

@ -28,7 +28,7 @@ export default class EmbeddableHost extends Component.extend(
const categoryId = host.category_id || this.site.uncategorized_category_id; const categoryId = host.category_id || this.site.uncategorized_category_id;
const category = Category.findById(categoryId); const category = Category.findById(categoryId);
host.set("category", category); this.set("category", category);
} }
@discourseComputed("buffered.host", "host.isSaving") @discourseComputed("buffered.host", "host.isSaving")
@ -60,7 +60,7 @@ export default class EmbeddableHost extends Component.extend(
host host
.save(props) .save(props)
.then(() => { .then(() => {
host.set("category", Category.findById(this.categoryId)); this.set("category", Category.findById(this.categoryId));
this.set("editToggled", false); this.set("editToggled", false);
}) })
.catch(popupAjaxError); .catch(popupAjaxError);