Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('#deactivateBtn').click(function(){
- $.ajax({
- url: '/api/v1/companies/{{ object.pk }}/',
- type: 'PATCH',
- contentType: 'application/json',
- data: {
- 'is_active': false,
- 'csrfmiddlewaretoken': '{{ csrf_token }}'
- },
- dataType: 'json',
- success: function(data){
- $('#deactivateBtn').hide();
- console.log('hiding');
- $('#deactivateSuccess').show();
- }
- })
- });
- REST_FRAMEWORK = {
- # Use Django's standard `django.contrib.auth` permissions,
- # or allow read-only access for unauthenticated users.
- 'DEFAULT_PERMISSION_CLASSES': [
- 'rest_framework.permissions.IsAuthenticated',
- ]
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement