like/dislike

This commit is contained in:
iriska-gri committed 2023-10-03 17:03:42 +03:00
1 parent 4e111f680f
commit a6feb8449f
5 files changed
+90 -55

No files matched your search

+1 -1
View File
@@ -28,6 +28,7 @@ class FeedbackAPIView(APIView):
instance=nowrating, # Передаём набор записей , "rat":serializer_for_queryset2.data
many=True # Указываем, что на вход подаётся именно набор записей
)
return Response({"basecrit":serializer_for_basecrit.data,
"nowrating":serializer_for_nowrating.data,
"nowcomment": serializer_for_nowcomment.data[0] if len(nowcomment)>0 else None
@@ -38,7 +39,6 @@ class FeedbackAPIView(APIView):
for x in request.data['nowrating']:
RatingStatus.objects.update_or_create(id=x['id'], defaults={'rating':x['rating'], 'crit_id':x['crit'], 'usercom_id':comment.id})
print(comment, created, 'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhh')
return Response({})