mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2026-10-25 14:10:05 -05:00
Replace deprecated success, error callbacks in $.ajax call with new functions .done and .fail.
This commit is contained in:
1 parent
81312d17e2
commit
41a8333145
39 files changed
+2817
-2821
No files matched your search
@@ -105,30 +105,30 @@ define('misc.sql', [
|
||||
);
|
||||
}, 1000);
|
||||
},
|
||||
success: function(res) {
|
||||
if (pgAdmin.Browser.editor.getValue() != res) {
|
||||
pgAdmin.Browser.editor.setValue(res);
|
||||
}
|
||||
clearTimeout(timer);
|
||||
},
|
||||
error: function(xhr, error, message) {
|
||||
var _label = treeHierarchy[n_type].label;
|
||||
pgBrowser.Events.trigger(
|
||||
'pgadmin:node:retrieval:error', 'sql', xhr, error, message, item
|
||||
})
|
||||
.done(function(res) {
|
||||
if (pgAdmin.Browser.editor.getValue() != res) {
|
||||
pgAdmin.Browser.editor.setValue(res);
|
||||
}
|
||||
clearTimeout(timer);
|
||||
})
|
||||
.fail(function(xhr, error, message) {
|
||||
var _label = treeHierarchy[n_type].label;
|
||||
pgBrowser.Events.trigger(
|
||||
'pgadmin:node:retrieval:error', 'sql', xhr, error, message, item
|
||||
);
|
||||
if (!Alertify.pgHandleItemError(xhr, error, message, {
|
||||
item: item,
|
||||
info: treeHierarchy,
|
||||
})) {
|
||||
Alertify.pgNotifier(
|
||||
error, xhr,
|
||||
S(gettext('Error retrieving the information - %s')).sprintf(
|
||||
message || _label
|
||||
).value(),
|
||||
function() {}
|
||||
);
|
||||
if (!Alertify.pgHandleItemError(xhr, error, message, {
|
||||
item: item,
|
||||
info: treeHierarchy,
|
||||
})) {
|
||||
Alertify.pgNotifier(
|
||||
error, xhr,
|
||||
S(gettext('Error retrieving the information - %s')).sprintf(
|
||||
message || _label
|
||||
).value(),
|
||||
function() {}
|
||||
);
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user