DEV: add appEvent for solution-toggled (#273)
This commit is contained in:
parent
5c84152b06
commit
dd8ebd24e8
|
@ -173,6 +173,8 @@ function initializeWithApi(api) {
|
||||||
const post = this.model;
|
const post = this.model;
|
||||||
acceptPost(post);
|
acceptPost(post);
|
||||||
|
|
||||||
|
this.appEvents.trigger("discourse-solved:solution-toggled", post);
|
||||||
|
|
||||||
post.get("topic.postStream.posts").forEach((p) => {
|
post.get("topic.postStream.posts").forEach((p) => {
|
||||||
p.set("topic_accepted_answer", true);
|
p.set("topic_accepted_answer", true);
|
||||||
this.appEvents.trigger("post-stream:refresh", { id: p.id });
|
this.appEvents.trigger("post-stream:refresh", { id: p.id });
|
||||||
|
@ -183,6 +185,8 @@ function initializeWithApi(api) {
|
||||||
const post = this.model;
|
const post = this.model;
|
||||||
unacceptPost(post);
|
unacceptPost(post);
|
||||||
|
|
||||||
|
this.appEvents.trigger("discourse-solved:solution-toggled", post);
|
||||||
|
|
||||||
post.get("topic.postStream.posts").forEach((p) => {
|
post.get("topic.postStream.posts").forEach((p) => {
|
||||||
p.set("topic_accepted_answer", false);
|
p.set("topic_accepted_answer", false);
|
||||||
this.appEvents.trigger("post-stream:refresh", { id: p.id });
|
this.appEvents.trigger("post-stream:refresh", { id: p.id });
|
||||||
|
|
Loading…
Reference in New Issue