update chat

This commit is contained in:
Parsa Nazer
2025-06-22 16:03:30 +03:30
parent 71b6545dd6
commit d9177e9fd2
+2 -2
View File
@@ -119,12 +119,12 @@ class ProductChatView(APIView):
paginated_messages = paginator.paginate_queryset(formatted_messages, request)
return paginator.get_paginated_response(paginated_messages)
def post(self, request, pk):
def post(self, request, slug):
"""
Send a new message in the product chat.
"""
user = request.user
product = get_object_or_404(ProductModel, id=pk)
product = get_object_or_404(ProductModel, slug=slug)
chat, created = ProductChatModel.objects.get_or_create(user=user, product=product)
if created: