fix: Add more error handling for app test (#1111)
This commit is contained in:
parent
c5d0769afb
commit
49dab6e72b
3 changed files with 18 additions and 7 deletions
2
public/js/app.js
vendored
2
public/js/app.js
vendored
File diff suppressed because one or more lines are too long
2
public/mix-manifest.json
generated
2
public/mix-manifest.json
generated
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"/css/app.css": "/css/app.css?id=910562b0b11f9731ff1cdded5e57f7b5",
|
||||
"/js/app.js": "/js/app.js?id=ab46f49cdc5f9f5b09dbb1b1e1d76cfe"
|
||||
"/js/app.js": "/js/app.js?id=f3b8ef4478792d0bf7c87b4148f5ca92"
|
||||
}
|
||||
|
|
|
@ -166,7 +166,8 @@ $.when($.ready).then(() => {
|
|||
const overrideUrl = $(
|
||||
'#sapconfig input[name="config[override_url]"]'
|
||||
).val();
|
||||
if (overrideUrl.length && overrideUrl !== "") {
|
||||
|
||||
if (typeof overrideUrl === "string" && overrideUrl !== "") {
|
||||
apiurl = overrideUrl;
|
||||
}
|
||||
|
||||
|
@ -183,10 +184,20 @@ $.when($.ready).then(() => {
|
|||
data.password = "";
|
||||
}
|
||||
|
||||
$.post(`${base}test_config`, { data }, (responseData) => {
|
||||
// eslint-disable-next-line no-alert
|
||||
alert(responseData);
|
||||
});
|
||||
$.post(`${base}test_config`, { data })
|
||||
.done((responseData) => {
|
||||
// eslint-disable-next-line no-alert
|
||||
alert(responseData);
|
||||
})
|
||||
.fail((responseData) => {
|
||||
// eslint-disable-next-line no-alert
|
||||
alert(
|
||||
`Something went wrong: ${responseData.responseText.substring(
|
||||
0,
|
||||
100
|
||||
)}`
|
||||
);
|
||||
});
|
||||
});
|
||||
$("#pinlist").on("click", "a", function (e) {
|
||||
e.preventDefault();
|
||||
|
|
Loading…
Reference in a new issue