Skip to content

Commit

Permalink
fix(admin-ui): use responseMessage from response body to display message
Browse files Browse the repository at this point in the history
Signed-off-by: Jeet Viramgama <jviramgama5@gmail.com>
  • Loading branch information
jv18creator committed Sep 11, 2023
1 parent 61a9bca commit 5736f26
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion admin-ui/app/redux/sagas/LicenseSaga.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ function* uploadNewSsaToken({ payload }) {
yield put(checkLicenseConfigValidResponse(false))
console.log(error)
yield put(
uploadNewSsaTokenResponse(error?.api_response?.body?.responseMessage || error.message)
uploadNewSsaTokenResponse(error?.response?.body?.responseMessage || error.message)
)
}
}
Expand Down
7 changes: 1 addition & 6 deletions admin-ui/app/utils/ApiUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@ const MAX_RETRIES = 1;

export function handleResponse(error, reject, resolve, data, response) {
if (error) {
let combinedError = new Error(error.message);
combinedError.error = error;
if(response) {
combinedError.api_response = response;
}
reject(combinedError)
reject(error)
if (error?.message?.toLocaleLowerCase()?.includes('timeout')) {
store.dispatch(handleApiTimeout({ isTimeout: true }))
}
Expand Down

0 comments on commit 5736f26

Please sign in to comment.