I have the following:
var archiveFolders = function (ids) {
var options = {// stuff}
return $.ajax(options)
}
archiveFolders(data).then(alert("heyo"));
But "heyo" is getting displayed immediately after the call to archiveFolders, NOT after the call finishes. How to I wait to display "heyo" until I get a response from the server?