This commit is contained in:
Nukeap committed 2025-01-13 08:13:58 +03:00
1 parent 02bd680383
commit 00263e6abc
2 files changed
+9 -7

No files matched your search

+2 -2
View File
@@ -9,11 +9,11 @@ import datetime
class GetVotes(APIView): class GetVotes(APIView):
def post(self, request): def get(self, request):
user = request.user user = request.user
# user = DictEmployee.objects.get(login='9966-00-125') # user = DictEmployee.objects.get(login='9966-00-125')
now = datetime.datetime.now() now = datetime.datetime.now()
status = request.data.get('params')['status'] status = request.query_params.get('status')
print(status) print(status)
votes = self.get_votes_by_status(status, now) votes = self.get_votes_by_status(status, now)
serialized_votes = VoteSerializer(votes, many=True).data serialized_votes = VoteSerializer(votes, many=True).data
+7 -5
View File
@@ -90,11 +90,13 @@ async error => {
async function getVotes(status) { async function getVotes(status) {
try { try {
const response = await axiosApiInstance.post('/api/vote/getvotes/', { const response = await axiosApiInstance.get(`/api/vote/getvotes?status=${status}`,
params: { // {
status, // params: {
} // status,
}); // }
// }
);
return response.data; return response.data;
} catch (error) { } catch (error) {
console.error('Ошибка запроса голосования:', error); console.error('Ошибка запроса голосования:', error);