From d9177e9fd2331ba51fec4de7b6b6484226d4a284 Mon Sep 17 00:00:00 2001 From: Parsa Nazer Date: Sun, 22 Jun 2025 16:03:30 +0330 Subject: [PATCH] update chat --- backend/chat/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/chat/views.py b/backend/chat/views.py index b806031..1be5eeb 100644 --- a/backend/chat/views.py +++ b/backend/chat/views.py @@ -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: