Make emoji picker work on client apps

This commit is contained in:
Andrew Godwin 2022-12-15 16:50:15 -07:00
parent 134bacd7ba
commit 3907a10d2e
3 changed files with 12 additions and 2 deletions

View file

@ -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

10
api/views/emoji.py Normal file
View file

@ -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()]

View file

@ -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