1
0
mirror of synced 2026-08-05 09:46:57 +00:00

FEATURE: Add API Scopes (#228)

Adds a single API scope for accepting or unaccepting a solution.
This commit is contained in:
Blake Erickson
2023-02-23 15:00:14 -07:00
committed by GitHub
parent 8a4daddb8e
commit 65a9ccf876
2 changed files with 10 additions and 0 deletions
+5
View File
@@ -49,6 +49,11 @@ en:
solved_event:
name: "Solved Event"
details: "When a user marks a post as the accepted or unaccepted answer."
api:
scopes:
descriptions:
solved:
answer: Accept/Unaccept a solution.
discourse_automation:
triggerables:
+5
View File
@@ -249,6 +249,11 @@ SQL
Discourse::Application.routes.append { mount ::DiscourseSolved::Engine, at: "solution" }
add_api_key_scope(
:solved,
{ answer: { actions: %w[discourse_solved/answer#accept discourse_solved/answer#unaccept] } },
)
topic_view_post_custom_fields_allowlister { ["is_accepted_answer"] }
def get_schema_text(post)