mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-03 22:47:03 +03:00
Set response ErrorCode as iError for easier fetch error handling
This commit is contained in:
parent
a46c0c3b21
commit
11fd6736bb
24 changed files with 145 additions and 253 deletions
|
|
@ -1,6 +1,5 @@
|
|||
import { Notification } from 'Common/Enums';
|
||||
import { pInt, pString } from 'Common/Utils';
|
||||
import { i18n } from 'Common/Translator';
|
||||
import { i18n, getNotification } from 'Common/Translator';
|
||||
|
||||
import Remote from 'Remote/Admin/Fetch';
|
||||
|
||||
|
|
@ -248,17 +247,13 @@ class DomainPopupView extends AbstractViewPopup {
|
|||
}
|
||||
}
|
||||
|
||||
onDomainCreateOrSaveResponse(iError, oData) {
|
||||
onDomainCreateOrSaveResponse(iError) {
|
||||
this.saving(false);
|
||||
if (!iError && oData) {
|
||||
if (oData.Result) {
|
||||
DomainAdminStore.fetch();
|
||||
this.closeCommand();
|
||||
} else if (Notification.DomainAlreadyExists === oData.ErrorCode) {
|
||||
this.savingError(i18n('ERRORS/DOMAIN_ALREADY_EXISTS'));
|
||||
}
|
||||
if (iError) {
|
||||
this.savingError(getNotification(iError));
|
||||
} else {
|
||||
this.savingError(i18n('ERRORS/UNKNOWN_ERROR'));
|
||||
DomainAdminStore.fetch();
|
||||
this.closeCommand();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue