Skip to content

Commit

Permalink
fix: JavaScript error 'getStringIfTextResponse not a function' fixed (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
grigoriev authored Aug 1, 2024
1 parent 1fcded1 commit 046195d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/src/main/resources/js/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ const SbbCommon = {
xhr.onreadystatechange = function () {
if (xhr.readyState === 4) {
if ([200, 202, 204].includes(xhr.status)) {
onOk(this.getStringIfTextResponse(xhr), xhr);
onOk(SbbCommon.getStringIfTextResponse(xhr), xhr);
} else {
const responseText = this.getStringIfTextResponse(xhr);
const responseText = SbbCommon.getStringIfTextResponse(xhr);
const error = responseText && JSON.parse(responseText);
const errorMessage = error && (error.message ? error.message : responseText);
if (onError === undefined) {
Expand Down

0 comments on commit 046195d

Please sign in to comment.