mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
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:
parent
312a5ead1f
commit
bf35928a14
@ -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}} />
|
||||||
|
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user