takahe/api/views/emoji.py

11 lines
264 B
Python
Raw Normal View History

2022-12-15 23:50:15 +00:00
from activities.models import Emoji
from api.schemas import CustomEmoji
from hatchway import api_view
2022-12-15 23:50:15 +00:00
@api_view.get
def emojis(request) -> list[CustomEmoji]:
return [
CustomEmoji.from_emoji(e) for e in Emoji.objects.usable().filter(local=True)
]