Change pause and unpause routes to POST

This commit is contained in:
Tanner Collin 2020-01-20 04:42:50 +00:00
parent 5a69e5d88d
commit 872a51f5f5
2 changed files with 4 additions and 4 deletions

View File

@ -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()

View File

@ -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);