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()
|
member = serializer.save()
|
||||||
utils.tally_membership_months(member)
|
utils.tally_membership_months(member)
|
||||||
|
|
||||||
@action(detail=True)
|
@action(detail=True, methods=['post'])
|
||||||
def pause(self, request, pk=None):
|
def pause(self, request, pk=None):
|
||||||
if not is_admin_director(self.request.user):
|
if not is_admin_director(self.request.user):
|
||||||
raise exceptions.PermissionDenied()
|
raise exceptions.PermissionDenied()
|
||||||
|
@ -152,7 +152,7 @@ class MemberViewSet(Base, Retrieve, Update):
|
||||||
member.save()
|
member.save()
|
||||||
return Response(200)
|
return Response(200)
|
||||||
|
|
||||||
@action(detail=True)
|
@action(detail=True, methods=['post'])
|
||||||
def unpause(self, request, pk=None):
|
def unpause(self, request, pk=None):
|
||||||
if not is_admin_director(self.request.user):
|
if not is_admin_director(self.request.user):
|
||||||
raise exceptions.PermissionDenied()
|
raise exceptions.PermissionDenied()
|
||||||
|
|
|
@ -293,7 +293,7 @@ export function AdminMemberPause(props) {
|
||||||
if (yousure) {
|
if (yousure) {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
setSuccess(false);
|
setSuccess(false);
|
||||||
requester('/members/' + id + '/pause/', 'GET', token)
|
requester('/members/' + id + '/pause/', 'POST', token, {})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
setYousure(false);
|
setYousure(false);
|
||||||
setSuccess(true);
|
setSuccess(true);
|
||||||
|
@ -313,7 +313,7 @@ export function AdminMemberPause(props) {
|
||||||
const handleUnpause = (e) => {
|
const handleUnpause = (e) => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
setSuccess(false);
|
setSuccess(false);
|
||||||
requester('/members/' + id + '/unpause/', 'GET', token)
|
requester('/members/' + id + '/unpause/', 'POST', token, {})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
setSuccess(true);
|
setSuccess(true);
|
||||||
setError(false);
|
setError(false);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user