1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Update Javascript to use new URLs from meta tags

This commit is contained in:
Benjamin Beganović 2021-03-08 10:00:11 +01:00
parent 722a416839
commit d20e5a0ebf

View File

@ -23,6 +23,8 @@ class Setup {
}
handleDatabaseCheck() {
let url = document.querySelector('meta[name=setup-db-check]').content;
let data = {
db_host: document.querySelector('input[name="db_host"]').value,
db_port: document.querySelector('input[name="db_port"]').value,
@ -36,7 +38,7 @@ class Setup {
this.checkDbButton.disabled = true;
Axios.post('/setup/check_db', data)
Axios.post(url, data)
.then((response) =>
this.handleSuccess(this.checkDbAlert, 'mail-wrapper')
)
@ -46,6 +48,8 @@ class Setup {
}
handleSmtpCheck() {
let url = document.querySelector('meta[name=setup-email-check]').content;
let data = {
mail_driver: document.querySelector('select[name="mail_driver"]')
.value,
@ -71,7 +75,7 @@ class Setup {
return (this.checkSmtpButton.disabled = false);
}
Axios.post('/setup/check_mail', data)
Axios.post(url, data)
.then((response) => {
this.handleSuccess(this.checkSmtpAlert, 'account-wrapper');
this.handleSuccess(this.checkSmtpAlert, 'submit-wrapper');
@ -83,9 +87,10 @@ class Setup {
}
handleTestPdfCheck() {
let url = document.querySelector('meta[name=setup-pdf-check]').content;
this.checkPdfButton.disabled = true;
Axios.post('/setup/check_pdf', {})
Axios.post(url, {})
.then((response) => {
try {
let win = window.open(response.data.url, '_blank');