diff --git a/src/back/vote/views.py b/src/back/vote/views.py index 122f929c1..d9b0ca69a 100644 --- a/src/back/vote/views.py +++ b/src/back/vote/views.py @@ -9,11 +9,11 @@ import datetime class GetVotes(APIView): - def post(self, request): + def get(self, request): user = request.user # user = DictEmployee.objects.get(login='9966-00-125') now = datetime.datetime.now() - status = request.data.get('params')['status'] + status = request.query_params.get('status') print(status) votes = self.get_votes_by_status(status, now) serialized_votes = VoteSerializer(votes, many=True).data diff --git a/src/front/src/utils/axios-api.js b/src/front/src/utils/axios-api.js index 2690f82b3..6d88670c9 100644 --- a/src/front/src/utils/axios-api.js +++ b/src/front/src/utils/axios-api.js @@ -90,11 +90,13 @@ async error => { async function getVotes(status) { try { - const response = await axiosApiInstance.post('/api/vote/getvotes/', { - params: { - status, - } - }); + const response = await axiosApiInstance.get(`/api/vote/getvotes?status=${status}`, + // { + // params: { + // status, + // } + // } + ); return response.data; } catch (error) { console.error('Ошибка запроса голосования:', error);