From 872a51f5f532e4e2e463d1f9af40b8c92925ab98 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Mon, 20 Jan 2020 04:42:50 +0000 Subject: [PATCH] Change pause and unpause routes to POST --- apiserver/apiserver/api/views.py | 4 ++-- webclient/src/Admin.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apiserver/apiserver/api/views.py b/apiserver/apiserver/api/views.py index e92d433..2550270 100644 --- a/apiserver/apiserver/api/views.py +++ b/apiserver/apiserver/api/views.py @@ -143,7 +143,7 @@ class MemberViewSet(Base, Retrieve, Update): member = serializer.save() utils.tally_membership_months(member) - @action(detail=True) + @action(detail=True, methods=['post']) def pause(self, request, pk=None): if not is_admin_director(self.request.user): raise exceptions.PermissionDenied() @@ -152,7 +152,7 @@ class MemberViewSet(Base, Retrieve, Update): member.save() return Response(200) - @action(detail=True) + @action(detail=True, methods=['post']) def unpause(self, request, pk=None): if not is_admin_director(self.request.user): raise exceptions.PermissionDenied() diff --git a/webclient/src/Admin.js b/webclient/src/Admin.js index 16ff8da..1526686 100644 --- a/webclient/src/Admin.js +++ b/webclient/src/Admin.js @@ -293,7 +293,7 @@ export function AdminMemberPause(props) { if (yousure) { setLoading(true); setSuccess(false); - requester('/members/' + id + '/pause/', 'GET', token) + requester('/members/' + id + '/pause/', 'POST', token, {}) .then(res => { setYousure(false); setSuccess(true); @@ -313,7 +313,7 @@ export function AdminMemberPause(props) { const handleUnpause = (e) => { setLoading(true); setSuccess(false); - requester('/members/' + id + '/unpause/', 'GET', token) + requester('/members/' + id + '/unpause/', 'POST', token, {}) .then(res => { setSuccess(true); setError(false);