Created
October 6, 2016 22:44
-
-
Save pcote/eab8655d5ec5ead821f1c43d629b26ce to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var revertDom = function(num){ | |
var __callback = function(creds){ | |
var uname = creds.username; | |
var pw = creds.password; | |
var authString = "Basic " + btoa(uname + ":" + pw); | |
var req = { | |
url: "/revert/" + num, | |
method: "get", | |
headers: { | |
"Authorization": authString | |
} | |
}; | |
var promise = $.ajax(req); | |
return promise; | |
}; | |
return __callback; | |
}; | |
var credsPromise = getCreds(); | |
var revertDomCB = revertDom(num); | |
var revertDomPromise = credsPromise.then(revertDomCB); | |
revertDomPromise.then(updateDomFields); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment