Change pause and unpause routes to POST
This commit is contained in:
parent
5a69e5d88d
commit
872a51f5f5
|
@ -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()
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user