Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Expose report categories via an API #30300

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ThisIsMissEm
Copy link
Contributor

For now, I've just added to the /api/v2/instance endpoint, however, we may want to actually move the localisation to the server-side, which would give us an API more like: /api/v1/report_categories or /api/v2/instance/report_categories which could then negotiate locale based on requesting user.

In this WIP iteration, this looks like the following in the response:

{
  // ...ommited the rest of the instance response
  "rules": [
    {
      "id": "1",
      "text": "Test Rule",
      "hint": ""
    }
  ],
  "report_categories": [
    {
      "name": "other"
    },
    {
      "name": "spam"
    },
    {
      "name": "legal"
    },
    {
      "name": "violation"
    }
  ]
}

The violation category is dynamically present based on whether or not the server has any rules defined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant