| Index: dashboard/dashboard/static/simple_xhr.html
|
| diff --git a/dashboard/dashboard/static/simple_xhr.html b/dashboard/dashboard/static/simple_xhr.html
|
| index 4e595f9bd02a7deea07a429966a37b58d0a93993..f9a353a5635d350cbe8da50d091d46bdc0e9f2c3 100644
|
| --- a/dashboard/dashboard/static/simple_xhr.html
|
| +++ b/dashboard/dashboard/static/simple_xhr.html
|
| @@ -11,7 +11,7 @@ found in the LICENSE file.
|
| // This variable name is supposed to not be camelCased, in order for it
|
| // to match up with the file name.
|
| // eslint-disable-next-line
|
| -var simple_xhr = (function() {
|
| +var simple_xhr = (function() {
|
|
|
| var LOGIN_ERROR_MESSAGE = 'Please check if you are logged in with a ' +
|
| 'google.com or chromium.org account in the ' +
|
| @@ -66,9 +66,14 @@ var simple_xhr = (function() {
|
| return request;
|
| };
|
|
|
| - return {
|
| - send: send
|
| + var asPromise = function(url, params) {
|
| + return new Promise((resolve, reject) => {
|
| + simple_xhr.send(
|
| + url, params, response => resolve(response), error => reject(error));
|
| + });
|
| };
|
| +
|
| + return {asPromise, send};
|
| })();
|
|
|
| </script>
|
|
|