summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--api/views/__init__.py1
-rw-r--r--api/views/emoji.py10
-rw-r--r--api/views/filters.py3
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