fix: Add more error handling for app test (#1111)

This commit is contained in:
Attila Kerekes 2023-02-01 10:43:26 +00:00 committed by GitHub
parent c5d0769afb
commit 49dab6e72b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 7 deletions

2
public/js/app.js vendored

File diff suppressed because one or more lines are too long

View file

@ -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"
}

View file

@ -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();