P-109
This commit is contained in:
1 parent
6c739dfc8b
commit
d36dbf50b1
2 files changed
+13
-1
No files matched your search
+12
-1
@@ -147,4 +147,15 @@ class GetResults(APIView):
|
||||
|
||||
serialized_results = VoteResultSerializer(results, many=True).data
|
||||
|
||||
return Response(serialized_results)
|
||||
return Response(serialized_results)
|
||||
|
||||
|
||||
class VoteResultCreate(APIView):
|
||||
def post(self, request):
|
||||
serializer = ResultSerializer(data=request.data)
|
||||
|
||||
if serializer.is_valid():
|
||||
serializer.save() # Сохраняем запись в базе данных
|
||||
return Response(serializer.data)
|
||||
|
||||
return Response(serializer.errors)
|
||||
Reference in new issue
Block a user