summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTatiana Ovchinnikova <t.v.ovtchinnikova@gmail.com>2023-05-09 14:04:35 -0500
committerVishal Manchanda <manchandavishal143@gmail.com>2023-05-11 04:22:50 +0000
commitc35d8f1c11ac283759ed2a5c1d4d19239002fb30 (patch)
treec44ca608da3e74c943c4aed9f7e636fa403a0d8d
parentd643547ed6f74d5d0372df47b6ac736e33486212 (diff)
downloadhorizon-stable/2023.1.tar.gz
Fix qos and trunks tablesstable/2023.1
When replacing deprecated custom callback methods success()/error() with then()/catch(), we need to keep in mind that methods' signatures and return values are different, so we need to explicitly return the response value when using then(function onSuccess(response){}). Closes-Bug: #2018232 Change-Id: I9d6d769075753c6395db2530a8d60ec28cafdc3d (cherry picked from commit c770785dcf6cb9d79ae26986ce5156e4ddc0f534)
-rw-r--r--openstack_dashboard/static/app/core/openstack-service-api/neutron.service.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/openstack_dashboard/static/app/core/openstack-service-api/neutron.service.js b/openstack_dashboard/static/app/core/openstack-service-api/neutron.service.js
index 1ebf2310d..7e5fee5ee 100644
--- a/openstack_dashboard/static/app/core/openstack-service-api/neutron.service.js
+++ b/openstack_dashboard/static/app/core/openstack-service-api/neutron.service.js
@@ -376,6 +376,7 @@
var promise = apiService.get('/api/neutron/qos_policies/' + id + '/')
.then(function onSuccess(response) {
convertDatesHumanReadable(response.data);
+ return response;
});
promise = suppressError ? promise : promise.catch(function onError() {
var msg = gettext('Unable to retrieve the policy with ID %(id)s');
@@ -398,6 +399,7 @@
response.data.items.forEach(function(policy) {
convertDatesHumanReadable(policy);
});
+ return response;
})
.catch(function onError() {
toastService.add('error', gettext('Unable to retrieve the qos policies.'));
@@ -812,6 +814,7 @@
var promise = apiService.get('/api/neutron/trunks/' + id + '/')
.then(function onSuccess(response) {
convertDatesHumanReadable(response.data);
+ return response;
});
promise = suppressError ? promise : promise.catch(function onError() {
var msg = gettext('Unable to retrieve the trunk with id: %(id)s');
@@ -834,6 +837,7 @@
response.data.items.forEach(function(trunk) {
convertDatesHumanReadable(trunk);
});
+ return response;
})
.catch(function onError() {
toastService.add('error', gettext('Unable to retrieve the trunks.'));