Set response ErrorCode as iError for easier fetch error handling

This commit is contained in:
djmaze 2021-03-18 12:33:13 +01:00
parent a46c0c3b21
commit 11fd6736bb
24 changed files with 145 additions and 253 deletions

View file

@ -60,13 +60,11 @@ export class PluginsAdminSettings {
}
onPluginDisableRequest(iError, data) {
if (!iError && data) {
if (!data.Result && data.ErrorCode) {
if (Notification.UnsupportedPluginPackage === data.ErrorCode && data.ErrorMessage && data.ErrorMessage) {
PluginAdminStore.error(data.ErrorMessage);
} else {
PluginAdminStore.error(getNotification(data.ErrorCode));
}
if (iError) {
if (Notification.UnsupportedPluginPackage === iError && data && data.ErrorMessage) {
PluginAdminStore.error(data.ErrorMessage);
} else {
PluginAdminStore.error(getNotification(iError));
}
}