diff options
author | Andrew Godwin | 2022-12-15 16:50:15 -0700 |
---|---|---|
committer | Andrew Godwin | 2022-12-15 16:50:30 -0700 |
commit | 3907a10d2e279d1974a829598067aea3797883dc (patch) | |
tree | 7fdb455b0a1f736dd385aeb7eb6b9ee09cef912e | |
parent | 134bacd7ba7670f50ab8af56ae68959833bcd004 (diff) | |
download | takahe-3907a10d2e279d1974a829598067aea3797883dc.tar.gz takahe-3907a10d2e279d1974a829598067aea3797883dc.tar.bz2 takahe-3907a10d2e279d1974a829598067aea3797883dc.zip |
Make emoji picker work on client apps
-rw-r--r-- | api/views/__init__.py | 1 | ||||
-rw-r--r-- | api/views/emoji.py | 10 | ||||
-rw-r--r-- | api/views/filters.py | 3 |
3 files changed, 12 insertions, 2 deletions
diff --git a/api/views/__init__.py b/api/views/__init__.py index f95fc21..917b8cd 100644 --- a/api/views/__init__.py +++ b/api/views/__init__.py @@ -1,5 +1,6 @@ from .accounts import * # noqa from .apps import * # noqa +from .emoji import * # noqa from .filters import * # noqa from .instance import * # noqa from .media import * # noqa diff --git a/api/views/emoji.py b/api/views/emoji.py new file mode 100644 index 0000000..0cdefb4 --- /dev/null +++ b/api/views/emoji.py @@ -0,0 +1,10 @@ +from activities.models import Emoji +from api.decorators import identity_required +from api.schemas import CustomEmoji +from api.views.base import api_router + + +@api_router.get("/v1/custom_emojis", response=list[CustomEmoji]) +@identity_required +def emojis(request): + return [e.to_mastodon_json() for e in Emoji.objects.usable()] diff --git a/api/views/filters.py b/api/views/filters.py index ec82a7d..261247a 100644 --- a/api/views/filters.py +++ b/api/views/filters.py @@ -1,7 +1,6 @@ +from api.decorators import identity_required from api.views.base import api_router -from ..decorators import identity_required - @api_router.get("/v1/filters") @identity_required |