added frontend for social + feed partiali working
This commit is contained in:
@@ -8,6 +8,7 @@ from rest_framework.permissions import IsAuthenticated
|
||||
from rest_framework.response import Response
|
||||
from drf_spectacular.utils import extend_schema, extend_schema_view
|
||||
|
||||
from vontor_cz.pagination import CreatedCursorPagination
|
||||
from .models import Chat, Message, MessageFile
|
||||
from .permissions import CanDeleteMessage, CanManageChat, IsChatMember, IsMessageSenderOnly
|
||||
from .serializers import ChatMemberSerializer, ChatSerializer, MessageSendSerializer, MessageSerializer
|
||||
@@ -155,10 +156,11 @@ class ChatViewSet(viewsets.ModelViewSet):
|
||||
)
|
||||
class MessageViewSet(viewsets.ModelViewSet):
|
||||
serializer_class = MessageSerializer
|
||||
pagination_class = CreatedCursorPagination
|
||||
filterset_fields = ['chat', 'sender', 'reply_to']
|
||||
search_fields = ['content']
|
||||
ordering_fields = ['created_at']
|
||||
ordering = ['created_at']
|
||||
ordering = ['-created_at']
|
||||
# Standard create is disabled — use POST /messages/send which handles files + WS broadcast
|
||||
http_method_names = ['get', 'patch', 'put', 'delete', 'post', 'head', 'options']
|
||||
|
||||
|
||||
Reference in New Issue
Block a user