update chat
This commit is contained in:
@@ -119,12 +119,12 @@ class ProductChatView(APIView):
|
|||||||
paginated_messages = paginator.paginate_queryset(formatted_messages, request)
|
paginated_messages = paginator.paginate_queryset(formatted_messages, request)
|
||||||
return paginator.get_paginated_response(paginated_messages)
|
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.
|
Send a new message in the product chat.
|
||||||
"""
|
"""
|
||||||
user = request.user
|
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)
|
chat, created = ProductChatModel.objects.get_or_create(user=user, product=product)
|
||||||
|
|
||||||
if created:
|
if created:
|
||||||
|
|||||||
Reference in New Issue
Block a user