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