I have a button in my html:
<button id="confirm-download" onclick="submit(getStudentsDetails)" data-dismiss="modal" class="btn btn-success">Confirm</button>
and these are the submit and getStudentsDetails functions
function submit(callback) {
    $('#download_resumes').attr('action', '/api/studentsdetails/');
    $('#download_resumes').submit();
    callback()
}
function getStudentsDetails() {
    $('#download_resumes').attr('action', '/api/studentsdetails/');
    $('#download_resumes').submit();
}
Now these functions are referring to this form:
<form  id = "download_resumes" action="api/" method = "POST">
The problem here is that, only the second api (/api/studentsdetails/) is getting called here. I want both of these apis to be called onClick of the button. 
The 2 APIs that need to be called are '/api/resumes/', '/api/studentsdetails/'.
 
     
    