Antonio-Maranhao closed pull request #1063: Remove JQuery uses from setup addon URL: https://github.com/apache/couchdb-fauxton/pull/1063
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/app/addons/setup/setup.actions.js b/app/addons/setup/setup.actions.js index 9d5209aec..7738c094d 100644 --- a/app/addons/setup/setup.actions.js +++ b/app/addons/setup/setup.actions.js @@ -10,6 +10,7 @@ // License for the specific language governing permissions and limitations under // the License. import FauxtonAPI from "../../core/api"; +import { post } from "../../core/ajax"; import SetupResources from "./resources"; import ActionTypes from "./setup.actiontypes"; import SetupStores from "./setup.stores"; @@ -32,16 +33,13 @@ export default { }, finishClusterSetup: function (message) { - - $.ajax({ - type: 'POST', - url: '/_cluster_setup', - contentType: 'application/json', - dataType: 'json', - data: JSON.stringify({ - action: 'finish_cluster' - }) - }).success(function () { + const body = { + action: 'finish_cluster' + }; + post('/_cluster_setup', body).then((res) => { + if (res.error) { + throw new Error(res.reason || res.error); + } FauxtonAPI.addNotification({ msg: message, type: 'success', @@ -49,7 +47,7 @@ export default { clear: true }); FauxtonAPI.navigate('#setup/finish'); - }).fail(function () { + }).catch(() => { FauxtonAPI.addNotification({ msg: 'There was an error. Please check your setup and try again.', type: 'error', @@ -57,7 +55,6 @@ export default { clear: true }); }); - }, setupSingleNode: function () { ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services