mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 07:39:16 +02:00
See #170: channels ui (listeners)
This commit is contained in:
parent
b74517ff33
commit
95497e76ac
79 changed files with 1768 additions and 232 deletions
|
@ -181,3 +181,15 @@ class AttachmentViewSet(
|
|||
if instance.actor is None or instance.actor != self.request.user.actor:
|
||||
raise exceptions.PermissionDenied()
|
||||
instance.delete()
|
||||
|
||||
|
||||
class TextPreviewView(views.APIView):
|
||||
permission_classes = []
|
||||
|
||||
def post(self, request, *args, **kwargs):
|
||||
payload = request.data
|
||||
if "text" not in payload:
|
||||
return response.Response({"detail": "Invalid input"}, status=400)
|
||||
|
||||
data = {"rendered": utils.render_html(payload["text"], "text/markdown")}
|
||||
return response.Response(data, status=200)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue