mirror of
https://ghfast.top/https://github.com/discourse/discourse-akismet.git
synced 2026-07-15 11:36:24 +08:00
45 lines
948 B
JavaScript
45 lines
948 B
JavaScript
export default {
|
|
confirmSpam(post) {
|
|
return Discourse.ajax("/admin/plugins/akismet/confirm_spam", {
|
|
type: "POST",
|
|
data: {
|
|
post_id: post.get("id")
|
|
}
|
|
});
|
|
},
|
|
|
|
allow(post) {
|
|
return Discourse.ajax("/admin/plugins/akismet/allow", {
|
|
type: "POST",
|
|
data: {
|
|
post_id: post.get("id")
|
|
}
|
|
});
|
|
},
|
|
|
|
dismiss(post) {
|
|
return Discourse.ajax("/admin/plugins/akismet/dismiss", {
|
|
type: "POST",
|
|
data: {
|
|
post_id: post.get("id")
|
|
}
|
|
});
|
|
},
|
|
|
|
deleteUser(post) {
|
|
return Discourse.ajax("/admin/plugins/akismet/delete_user", {
|
|
type: "DELETE",
|
|
data: {
|
|
user_id: post.get("user_id"),
|
|
post_id: post.get("id")
|
|
}
|
|
});
|
|
},
|
|
|
|
findAll() {
|
|
return Discourse.ajax("/admin/plugins/akismet/index.json").then(function(result) {
|
|
result.posts = result.posts.map(p => Discourse.Post.create(p));
|
|
return result;
|
|
});
|
|
}
|
|
};
|