fix: show the error message received from the server when sending test email fails (#11972)
This commit is contained in:
parent
a486474483
commit
7443c16e59
|
|
@ -110,6 +110,9 @@ function* SendTestEmail(action: ReduxAction<SendTestEmailPayload>) {
|
||||||
try {
|
try {
|
||||||
const response = yield call(UserApi.sendTestEmail, action.payload);
|
const response = yield call(UserApi.sendTestEmail, action.payload);
|
||||||
const currentUser = yield select(getCurrentUser);
|
const currentUser = yield select(getCurrentUser);
|
||||||
|
const isValidResponse = yield validateResponse(response);
|
||||||
|
|
||||||
|
if (isValidResponse) {
|
||||||
let actionElement;
|
let actionElement;
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
actionElement = (
|
actionElement = (
|
||||||
|
|
@ -131,13 +134,8 @@ function* SendTestEmail(action: ReduxAction<SendTestEmailPayload>) {
|
||||||
hideProgressBar: true,
|
hideProgressBar: true,
|
||||||
variant: response.data ? Variant.info : Variant.danger,
|
variant: response.data ? Variant.info : Variant.danger,
|
||||||
});
|
});
|
||||||
} catch (e) {
|
|
||||||
Toaster.show({
|
|
||||||
text: e?.message || createMessage(TEST_EMAIL_FAILURE),
|
|
||||||
hideProgressBar: true,
|
|
||||||
variant: Variant.danger,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
} catch (e) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
function* InitSuperUserSaga(action: ReduxAction<User>) {
|
function* InitSuperUserSaga(action: ReduxAction<User>) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user